Counting Records in a report

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have a report based on a query showing the number of students absent from
class
I want to count the number of students who are absent each day . The field
name is InClass and it is a true false field
the number who are tardy each day. The field name is Tardy and it is a true
false field
the overall number of days of class so far for which I have taken attendance
The count function doesn't seem to be working

I tried =count([InClass]=False)
and =count([Tardy]=True)

any other suggestions?
 
Tom said:
I have a report based on a query showing the number of students absent from
class
I want to count the number of students who are absent each day . The field
name is InClass and it is a true false field
the number who are tardy each day. The field name is Tardy and it is a true
false field
the overall number of days of class so far for which I have taken attendance
The count function doesn't seem to be working

I tried =count([InClass]=False)
and =count([Tardy]=True)


Those won't work because Count counts all records where the
expression is not Null (ie it has nothing to do with the
True/False value of the expression.

Use the Sum function instead:

=Sum(IIf(InClass, 0, 1))
or
=Count(IIf(Not InClass, 1, Null))
or
=Abs(Sum(Not InClass))
or
=-Sum(Not InClass)
or
. . .
 
Back
Top