View Full Version : Count Multiple Fields


Mickster
06-26-2006, 02:03 PM
hi there,

I have been struggling over this the past few days and get no where. I am trying to count the number of times Yes appears in a few fields. This is what I have right now in design view:

Field1YesCount: Count(IIF([Field1] = True,1,0))

Field2YesCount: Count(IIF([Field2] = True,1,0))

Field3YesCount: Count(IIF([Field3] = True,1,0))

This doesnt seem to work, could someone please help.

Thanks

Liv Manto
06-26-2006, 03:53 PM
hi there,

I have been struggling over this the past few days and get no where. I am trying to count the number of times Yes appears in a few fields. This is what I have right now in design view:

Field1YesCount: Count(IIF([Field1] = True,1,0))

Field2YesCount: Count(IIF([Field2] = True,1,0))

Field3YesCount: Count(IIF([Field3] = True,1,0))

This doesnt seem to work, could someone please help.

Thanks

Your Field has either True or False, why do you have to count per field... There is only one count per field..

You can put the iif(field1 = true, 1, 0) then at the summary page, you can summarize the above values...

neileg
06-27-2006, 01:30 AM
Yes or True is stored as -1. No or False is stored as 0. So all you need to do is sum the Yes/No field and change the sign and you have the number of yes answers.