Multiple IIF in a query

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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"))
 
What criteria? Your post didn't mention any selection criterion. Where
have you entered the IIF() statement?

Jeff Boyce
<Access MVP>
 
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.
 
Back
Top