count yes from yes/no field

C

Carol Ann

Help!
I have a Training database with a table that has multiple
yes/no fields that I need to have a count or total of the
yes (true) for each field. I have a query written but it
is giving me a result of the same total for every field.
(which is true for the first field but not the rest) It's
counting all spaces and I need it to only count the yes.
Please help.
Thanks.
ca
 
H

Harry

Try putting this in your query:
YesCount: Sum(IIF([FieldName],1,0))
If you should want a count for no, just reverse the
numbers:
NoCount: Sum(IIF ([FieldName], 0,1))

-- Harry
 
C

CarolAnn

Harry,
You are awesome.
Thanks.
ch
-----Original Message-----
Try putting this in your query:
YesCount: Sum(IIF([FieldName],1,0))
If you should want a count for no, just reverse the
numbers:
NoCount: Sum(IIF ([FieldName], 0,1))

-- Harry

-----Original Message-----
Help!
I have a Training database with a table that has multiple
yes/no fields that I need to have a count or total of the
yes (true) for each field. I have a query written but it
is giving me a result of the same total for every field.
(which is true for the first field but not the rest) It's
counting all spaces and I need it to only count the yes.
Please help.
Thanks.
ca


.
.
 

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

Similar Threads


Top