Count IIF

  • Thread starter Thread starter tlynnlow
  • Start date Start date
T

tlynnlow

I have a field that has two possible answer choices for example: "red apples"
or "green apples". In my report, I would like to count how many people
picked "red apples". I cannot get this to work. Any suggestions?
 
I have a field that has two possible answer choices for example: "red apples"
or "green apples". In my report, I would like to count how many people
picked "red apples". I cannot get this to work. Any suggestions?

And the datatype of this field is what? Text? Number? Boolean?
Assuming, from your example, that it is Text datatype, then. using an
unbound control, set it's control source to:
=Sum(IIf([FieldName] = "red apples",1,0)
Use another control:
=Sum(IIf([FieldName] = "green apples",1,0)
You can place the control anywhere in the report except the Page
Header or Page Footer.
 
Back
Top