Solved

how to use If condition?

Posted on 2009-04-09
11
159 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
Comment Utility
Use a CASE statement
0
 
LVL 23

Expert Comment

by:apresto
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:dina78
Comment Utility
=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
Comment Utility
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
Comment Utility
=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
Comment Utility
same problem,, IFF function undefined
0
 
LVL 11

Expert Comment

by:bmatumbura
Comment Utility
It's IIF and NOT IFF
0
 

Author Comment

by:dina78
Comment Utility
ops!
working just fine now
thanks for the help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

12 Experts available now in Live!

Get 1:1 Help Now