Grouping Footer Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there anything wrong with my Control Source Expression? How come I got a
result, "1" even though I do not have anything similar when using "Count"
Expression in the table.

=Count([Status]="3")

Can Anyone guide me the right expression?
 
Status="3" will return either 0 or -1. Count() will count all non-null
values. Both 0 and -1 are not null. If you want to count the values that
meet a condition, use:
= Sum(Abs( {your condition} ))
 
I got new error coming out. It said, " Cannot Have Aggregate Function In
Expression " Sum(Abs(Count([Status]="3"))) ". "

What Happened?

Duane Hookom said:
Status="3" will return either 0 or -1. Count() will count all non-null
values. Both 0 and -1 are not null. If you want to count the values that
meet a condition, use:
= Sum(Abs( {your condition} ))

--
Duane Hookom
MS Access MVP
--

Seikyo said:
Is there anything wrong with my Control Source Expression? How come I got
a
result, "1" even though I do not have anything similar when using "Count"
Expression in the table.

=Count([Status]="3")

Can Anyone guide me the right expression?
 
Provide your entire SQL and what you are attempting to accomplish.

--
Duane Hookom
MS Access MVP
--

Seikyo said:
I got new error coming out. It said, " Cannot Have Aggregate Function In
Expression " Sum(Abs(Count([Status]="3"))) ". "

What Happened?

Duane Hookom said:
Status="3" will return either 0 or -1. Count() will count all non-null
values. Both 0 and -1 are not null. If you want to count the values that
meet a condition, use:
= Sum(Abs( {your condition} ))

--
Duane Hookom
MS Access MVP
--

Seikyo said:
Is there anything wrong with my Control Source Expression? How come I
got
a
result, "1" even though I do not have anything similar when using
"Count"
Expression in the table.

=Count([Status]="3")

Can Anyone guide me the right expression?
 
I am doing a report which display TimeCard for workers. It got daily time in
and out and status. For status, It got 3 status, "MC", "Off-In-Liew",Annual
Leave". In order to count the number of MC a worker take. I need to use
"Count" Expression to get the total amount of MC that particular worker took.


This report which I am creating is to all the worker to know how many MC you
took and also for Payroll department to deduct the money. Hence I decided to
put it at Grouping Footer which in then will display all the timecard
schedule and end off with a total count of MC. I try to use
"=Sum(Count((Field)))", which then count start at 1.

Hope you reply soon.
 
What do you mean by "need to use "Count" expression to get the total amount
of MC"?
Did you understand my first reply regarding Count and Null etc.

Maybe you need to type in a few records and the desired display in a report.
 
Back
Top