When I do an IIf Count for one field it works fine but when I put a few
together I get an error. Example:
=Count(IIf(Field1]=1,0)) ...... works fine
=Count(IIf(Field1]=1,0)),Count(IIf([Field2]=5,0)) ..... gives errors
Anyway to put these two together?
You may know what result you are looking to get but we can't see your
computer, and your expression doesn't make sense, even just for the
one that you say works fine.
If the value of [Field1]=1 you wish to do what?
And what is the purpose of that last 0?
I think what you wish to do is count how many records show a 1 in the
[Field1] field. If that is so, then:
=Sum(IIf([Field1]= 1, 1, 0))
The above will add 1 for each record whose [Field1] = 1, giving you
the total count.
The second expression makes even less sense to me.
Are you trying to get the cumulative count of how many records in
[Field1] = 1 or [Field2] = 5?
Try:
=Sum(IIf([Field1] = 1 or [Field2] = 5, 1, 0))
If you mean something else, I'd suggest you post back with an example
to clarify what it is you want to accomplish.