How to use IIF when more than two alternatives exist

dgp

New member
Local time
Today, 04:49
Joined
Aug 4, 2006
Messages
5
Hi,
My database has 3 fields ID,Cust_Balance,Cust_Type.
I need to assign Cust_Type as 1,2,or 3 based on Cust_Balance amount.
If Cust_balance is lessthan 3 million then Cust_Type is 1,if between 3 and
10 million then type 2 and,more than 10 million as type 3.How do i accomplish this in Access ?Is IIf the right choice?:confused:
 
Try something like:
iif([cust_balance]<3000000,1, iif([cust_balance]<10000000,2,3))

Basically this is saying if less than 3,000,000 then variable is 1; if less than 10,000,000 (but not less than 3,000,000 as that has already been covered) then variable is 2; if greater than 10,000,000 (as everything below has now been covered) then variable is 3
 

Users who are viewing this thread

Back
Top Bottom