Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help - How to Count Yes/No Type in Reports

Status
Not open for further replies.

dkmidi

Technical User
Mar 13, 2002
47
CA
Hi there,

I have a table that has one field set up as Yes/No type. I've created a report but how can I count only the "Yes" responses to a question? I've tried using a statement like =iif([mytable]![Certified]=Yes, count([mytable]![certified],)

The above is just an example but does anyone know how to count only the Yes responses or only the No responses? Thanks!

dk
 
Or you could always

Sum(MyField) * -1 to get the YESs,

Count(myField) - (Sum(MyField)* -1) to get the NOs

Or to just do it all at once..

SELECT Count(Table1.YESNO) AS CountOfYESNO, Sum([YESNO])*-1 AS YESCOUNT, Count([YESNO])-[YesCount] AS NOCOUNT
FROM Table1;




Remember, you're unique - just like everyone else
You're invited to visit another free Access forum:
or my site,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top