I have a report that lists employees and their job function. At the bottom
of the report I want to list each job function and count how many people do
that function. This is not working for me, any idea what I'm doing wrong.
Thank you
=Count([JobFunctionID])="Typist"
Count() counts everything that isn't null. The expression
([JobFunctionID])="Typist"
will evaluate to either -1/True or 0/False. Count() will count all the -1
and 0 values.
You can use:
=Sum(Abs([JobFunctionID]="Typist"))
If you have multiple JobFunctions, then you might want to use a subreport
that has a Record Source that Groups By JobFunctionID and Counts
JobFunctionID.

Signature
Duane Hookom
Microsoft Access MVP
> I have a report that lists employees and their job function. At the bottom
> of the report I want to list each job function and count how many people do
> that function. This is not working for me, any idea what I'm doing wrong.
> Thank you
>
> =Count([JobFunctionID])="Typist"
PowellGirlTN - 07 Mar 2008 00:19 GMT
Thanks so much for your explanation, may I ask though what does ABS indicate?
Thanks again.
> Count() counts everything that isn't null. The expression
> ([JobFunctionID])="Typist"
[quoted text clipped - 13 lines]
> >
> > =Count([JobFunctionID])="Typist"
Duane Hookom - 07 Mar 2008 01:58 GMT
Abs() returns the absolute value of the expression.
[JobFunctionID]="Typist" will evaluate to -1 or 0
Abs([JobFunctionID]="Typist") changes -1 to +1
Sum(Abs([JobFunctionID]="Typist")) sums the absolute value

Signature
Duane Hookom
Microsoft Access MVP
> Thanks so much for your explanation, may I ask though what does ABS indicate?
> Thanks again.
[quoted text clipped - 16 lines]
> > >
> > > =Count([JobFunctionID])="Typist"