Solved

how to use If condition?

Posted on 2009-04-09
11
171 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
 

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mySql Syntax 7 44
PL/SQL - Leading zeros 7 58
Supress rows in SSRS table based on Like or Soundex 2 39
Using OPENQUERY in a SELECT statement 6 36
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now