Link to home
Start Free TrialLog in
Avatar of dina78
dina78Flag for Afghanistan

asked on

how to use If condition?

I have a loan amount with different values
if loan amount > 30,000 then  points should be 10
else if  is loan amount between 15,000 and 29,999  points should be 6
Else if loan amout between 10,000 and 14,999 points should be 3
how can i do that in access:)
can anyone help me?
Avatar of bmatumbura
bmatumbura

Use a CASE statement
Have a look here, you need the IIF function by the sounds of things. MS Access doesnt support standard IF or CASE statements, unlike most other databases packages:
http://www.techonthenet.com/access/functions/advanced/iif.php 
Ah, sorry hadn't realized you are using Access; use an IIF statement instead:

https://www.experts-exchange.com/questions/22840470/Case-Statement-for-MS-Access-Query.html
Avatar of dina78

ASKER

just to confirm,,
i would wirte
=iff ( loan amount >30000, "10", iff(loan amount >15,000 and <29,000), "6", iff(loan amount >10,000 and <14,99), "3")
correct?
I think it would be:
iff ( loan amount >30000, "10", iff(loan amount >15,000 and <29,000, "6", iff(loan amount >10,000 and <14,99, "3")))
 
Avatar of dina78

ASKER

=iff ( [loan Q1 incentives]![loan amount] >30000, "10", iff( [loan Q1 incentives]![loan amount] >15000 and < 29999, "6", iff( [loan Q1 incentives]![loan amount] >10000 and <14999, "3")))

but it is giving that
the expression you have entered contains invalid syntaz
help?
Avatar of dina78

ASKER

i used
 iff ([loan Q1 incentives]![loan amount]>30000,"10",iff(([loan Q1 incentives]![loan amount] Between 15000 And 29999),"6",iff(([loan Q1 incentives]![loan amount] Between 10000 And 14999),"3")))

but got an error of undefined function iff in expression
ASKER CERTIFIED SOLUTION
Avatar of apresto
apresto
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dina78

ASKER

same problem,, IFF function undefined
It's IIF and NOT IFF
Avatar of dina78

ASKER

ops!
working just fine now
thanks for the help