Count or DCount used in a report

  • Thread starter Thread starter cooksc
  • Start date Start date
C

cooksc

In my underlying query I have field called "Employee" that has either CAT or
Volt as the data that input.
This is how my report looks

Shift Header
Supervisor Header
Area Header
Employee Header
Area Header
Current Job Header
Detail
Employee Footer
Area Footer
="Total Count for " & [shift] &
IIf([shift]=1,"st",(IIf([shift]=2,"nd","rd"))) & " Shift " & [area] & ": " &
Count([Query1]![TechName])....this formula works how I want it to.
Supervisor Footer
=DCount("*","[query1]","[employee] = 'cat")........this
formula is counting ALL the Cat in the query, I want to count only the cat
for each supervisor
=DCount("*","[query1]","[employee] = 'volt'").......this
formula is counting ALL the Volt in the quey, I want to count only the Volt
for each supervisor
=Count([Query1]![techname]).......this formula is
counting all the "techname" for each supervisor and is working like I want it
to

Please let me know what I'm doing wrong.
Thanks in advance
 
I rarely if ever use DCount() in reports. If you are counting based on a
condition within a report or a section of the report, you should use =Count()
or Sum(). The condition inside the Abs() will evaluate to either True/-1 or
False/0. The Abs() function returns the absolute value of the expression. The
Sum() sums the 1s and 0s.

=Sum(Abs([employee] = "cat"))
=Sum(Abs([employee] = "volt"))
 
Back
Top