Counting Records in a report

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?
 
M

Marshall Barton

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
. . .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top