x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 201

# 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?
0
dina78
• 5
• 3
• 3
1 Solution

Commented:
Use a CASE statement
0

Commented:
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:
0

Commented:
Ah, sorry hadn't realized you are using Access; use an IIF statement instead:

http://www.experts-exchange.com/Programming/Languages/SQL_Syntax/Q_22840470.html
0

Author Commented:
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?
0

Commented:
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")))

0

Author Commented:
=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?
0

Author Commented:
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
0

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

Try that, specify the field in each clause
0

Author Commented:
same problem,, IFF function undefined
0

Commented:
It's IIF and NOT IFF
0

Author Commented:
ops!
working just fine now
thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.