=Count(IIF...

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Using the syntax from a few posts down, I am trying to
count the instances of "Yes" in a yesno field. The
expression that I am using, is the following:
=Count(IIf([Washout] = "Yes", 1, Null))

When I go to run the report, however, I get an error
telling me that the expression is too complex. Can anyone
tell me what I am doing wrong?

Thanks,
Jason
 
Using the syntax from a few posts down, I am trying to
count the instances of "Yes" in a yesno field. The
expression that I am using, is the following:
=Count(IIf([Washout] = "Yes", 1, Null))

When I go to run the report, however, I get an error
telling me that the expression is too complex. Can anyone
tell me what I am doing wrong?

Thanks,
Jason

To count Yes values in a Yes/No field all you need do is sum them.
Since the value of a Yes Check Box is -1, summing will give you a
negative result.
The ABS() function returns it's Absolute value (a positive number):
=ABS(Sum([WashOut]))

Further, A Yes/No field is a Number datatype, not text, so your use of
IIf([Washout] = "Yes", would be incorrect anyway.
IIf([Washout] = Yes, would have been correct.
 
Back
Top