displaying the number of Yes's in a Yes/No field

G

Guest

I know its been asked before but in my table theres a field where all records
have either Yes or No and I need to do a count of all the Yes's. until about
a week ago I'd never used access before so i'm afraid i need it explained a
little. I've come across a few different formulas to use but I'm not even
sure where to enter them in the QBE grid. Any tips?
 
J

Jeff Boyce

Since Access stores Yes in a Yes/No field as a value of -1 (No's are 0), you
could use a Totals query (the 'sigma'/backwards 3 button) to Count the
number of records with a Yes.

Or you could simply "add" up the value of all the record's answers, and use
the ABS() (absolute value) function to get a positive number, the count of
Yes's.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Here's the way I usually do it:
Create a query and for each Yes/No field put IIf([Yes/No] = Yes, 1, 0)
Then select View Totals and change the 'group by' to 'Sum'.

For each record that is 'Yes' 1 is returned, for each that is 'No' 0 is
returned. So the Sum just adds them all together.

Steve
 

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