IIf statements using AND

  • Thread starter Thread starter John Barnes
  • Start date Start date
J

John Barnes

Is it possible to use an immediate if statement in a
report footer to calculate whether two conditions are
true? I am trying to use:

=Sum(IIf([Age]=1 And [Gender]=2,1,0))

To return a total of records that meet both criteria. I
either get all zeros or "this expression is typed
incorrectly or is too complex . . ." error message. Is
there a better way to count a record which tests records
for two fields?
 
You can try:
=Abs( Sum([Age]=1 And [Gender]=2) )
I'm not sure why your expression failed.
 
Back
Top