View Single Post
  #1  
Old January 3rd, 2007, 04:38 PM posted to microsoft.public.access.queries
RaeRae
external usenet poster
 
Posts: 4
Default #Error on IIF Statement

I have a query that I need to have return a calculation for me. I'm not sure
why I'm getting this error. Can someone help?

My fields have a Quantity, Unit Price, and Discount. I've created an
ExtPrice field that gives me the Unit Price - Discount * Quantity. Works
fine.

I now need to create fields that will calculate the commission. I have 5
possible commission rates to calculate. My understanding is that iif
expression's can not contain more than one argument. At least I couldn't make
it work, if it is allowed. I decided to write an arguement for each senario
instead. My expression is as follows.

Ret: IIf([Discount]="0.00%",[Quantity]*100)
DLR: IIf([discount]="25%",[quantity]*50)3
DLR+: IIf([discount]="32.5%",[quantity]*27)
DIS: IIf([discount]="40%",[quantity]*18)
DIS+: IIf([discount]="46%",[quantity]*5.4)

all return the #error

Thanks for your help

--
RaeRae