View Full Version : Count Multiple Fields


Mickster
06-26-2006, 02:05 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

RV
06-26-2006, 02:13 PM
Field1YesCount: -1*Sum([Field1])

Et cetera.

RV

Mickster
06-26-2006, 02:18 PM
Thanks a lot that worked!!! The help is much appreciated.....if you dont mind so could you please explain the syntax.

RV
06-27-2006, 01:19 PM
Thanks a lot that worked!!! The help is much appreciated.....if you dont mind so could you please explain the syntax.

Sure, no prob.
Yes = -1, No = 0.
So by summing all values you'll get -1 multiplied by the number of times you ticked "yes".
Multiplying the sum hence results in the requested total.

RV