Multiple IIF in a query

G

Guest

Hi,

I'm looking for the text for inserting multiple IIF statements into a query
I have. I currently have:

IIf([Province]="4",([TuitionFee]*0.08),IIf([Province]="7",[TuitionFee]*0.08,"0"))

I don't get error an when i enter the statment but my records that do not
match the criteria are coming up as #Error. However, the calcualtion is
working for the criteria that does match.

Any help is much appreciated.

Thanks

Bhavini
 
G

Guest

You might have a problem when TuitionFee is null, in that case try and use
the NZ function


IIf([Province]="4",(nz([TuitionFee],0)*0.08),IIf([Province]="7",nz([TuitionFee],0)*0.08,"0"))
 
J

Jeff Boyce

What criteria? Your post didn't mention any selection criterion. Where
have you entered the IIF() statement?

Jeff Boyce
<Access MVP>
 
D

Duane Hookom

When you start creating complex expression with values that WILL CHANGE in
time, it is much better to create a user-defined function and save it in a
module of business calculations.
 

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