count yes from yes/no field

  • Thread starter Thread starter Carol Ann
  • Start date Start date
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
 
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
 
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


.
.
 
Back
Top