Solved

how to use If condition?

Posted on 2009-04-09
11
179 Views
Last Modified: 2012-05-06
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
Comment
Question by:dina78
  • 5
  • 3
  • 3
11 Comments
 
LVL 11

Expert Comment

by:bmatumbura
ID: 24105363
Use a CASE statement
0
 
LVL 23

Expert Comment

by:apresto
ID: 24105393
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 
0
 
LVL 11

Expert Comment

by:bmatumbura
ID: 24105395
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:dina78
ID: 24105574
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
 
LVL 23

Expert Comment

by:apresto
ID: 24105609
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 Comment

by:dina78
ID: 24105699
=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 Comment

by:dina78
ID: 24105739
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
 
LVL 23

Accepted Solution

by:
apresto earned 500 total points
ID: 24105951
=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 Comment

by:dina78
ID: 24105980
same problem,, IFF function undefined
0
 
LVL 11

Expert Comment

by:bmatumbura
ID: 24106108
It's IIF and NOT IFF
0
 

Author Comment

by:dina78
ID: 24124644
ops!
working just fine now
thanks for the help
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question