Counting query with 3 yes/no fields

Pusher

BEOGRAD Put
Local time
Today, 19:43
Joined
May 25, 2011
Messages
230
Hi all,
I want to make a count query – in my table I have 3 Yes/No fields. I want to make 1 query that will count them all and result is Field1-Count Field2-count Field3-count. How do I do this?
Thanks
 
To get a total count for each field, try this:

SELECT Sum(IIf([HasCar]=True,1,0)) AS [Has Car], Sum(IIf([Field1]=True,1,0)) AS [Has Laptop], Sum(IIf([Field2]=True,1,0)) AS [Field3]
FROM tblContacts;
 

Users who are viewing this thread

Back
Top Bottom