Count...IIf...?

paulreed

Registered User.
Local time
Today, 22:04
Joined
Jan 30, 2003
Messages
42
I have a query based upon 3 tables, and want to have a report which will calculate scenarios from the data.
The query contains the fields 'date', 'incident' and 'void' (as well as some others).
I want the report to include; the count of 'incident's where they are not 'void', and also the number of 'incident's where they are void, but having problems!
I have tried the following;
count (IIf ([void]=no, 1, 0))
and
count (IIf ([void]=Yes, 1, 0))
But I get the same result on both text boxes - 124, instead of not void = 74 and void = 50.

I have searched through the forum and found just one similar post, which does not appear to help in resolving my problem.
 
Try Sum() instead of Count()
 
Thanks Paul

I have settled upon
=Abs(Sum([Void])) to count the number of void records, and
=(Count([incidentnum]))-(Abs(Sum([Void]))) to count the 'not void' records.

Works great.
 

Users who are viewing this thread

Back
Top Bottom