How do I set up an IIF Statement in a report that has three condi.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I set up an IIF Statement in a Report that has three conditions. I
have used the follwoing statement but it only uses two conditions. When I
add to the statement LunchType="S" It does not read the Grade>="7". It
gives me all records that is equal to H or S in the Lunch Type Field. I am
counting the records that have H or S in the LunchType Field and they need to
be in Grade 7 or above.

This is my current statement: =Sum(IIf([LunchType]="H" And [Grade]>="7",1,0))

I need to add LunchType="S" somewhere but how???????

Thanks,

Robin
 
Robin said:
How do I set up an IIF Statement in a Report that has three conditions.
I
have used the follwoing statement but it only uses two conditions. When I
add to the statement LunchType="S" It does not read the Grade>="7". It
gives me all records that is equal to H or S in the Lunch Type Field. I
am
counting the records that have H or S in the LunchType Field and they need
to
be in Grade 7 or above.

This is my current statement: =Sum(IIf([LunchType]="H" And
[Grade]>="7",1,0))

I need to add LunchType="S" somewhere but how???????

Try this:

=Sum(IIf(([LunchType]="H" Or [LunchType]="S") And [Grade]>="7",1,0))

Tom Lake
 
Robin,

Try it like this...
=Sum(IIf([LunchType] In("H","S") And [Grade]>="7",1,0))

or...
=Sum(Abs([LunchType] In("H","S") And [Grade]>="7"))

I hope your Grades system doesn't go above 9?
 
Back
Top