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

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
 
T

Tom Lake

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
 
S

Steve Schapel

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top