Using Iif and Between

razorking

Registered User.
Local time
Today, 14:38
Joined
Aug 27, 2004
Messages
332
Being stupid yest again, Have been searching the net and trying to figure it out but...am spending to much time with no good results. Hope someone here can give me a clue.

I have numerical values in a table of a field. I need to display results in a query something like this, using a new field based upon a field called - PRICE
If price >0 - A
If Price >5 - B
If Price >10 - C
If Price >15 - D

Assumimg there is a way to do this using an Iif but not sure who to write it.

Thanks!
 
Expr1: IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D")))


If Price may be Null,

Expr1: IIf(IsNull(Price),Null, IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D"))))

^
 
EMP said:
Expr1: IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D")))


If Price may be Null,

Expr1: IIf(IsNull(Price),Null, IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D"))))

^


That works, thank you very much EMP...very much appreciated.

That saves me some time
 

Users who are viewing this thread

Back
Top Bottom