Solved

MS ACCESS 2007 syntax on ACCESS:  IIF/Or statement

Posted on 2014-03-27
3
550 Views
Last Modified: 2014-03-28
the following script runs and delivers good results on the pre-"Or" statement.  However, it is ignoring the post-"Or" statement:

TG:
IIf([Do we want to see an increase in this Measure?]=True And [TmsrAmt]![Target]>[Data],[TmsrAmt]![Target],[Data]-([Data]*0.05)
Or
 IIf([Do we want to see an increase in this Measure?]=False And [TmsrAmt]![Target]>[Data],[Data]-([Data]*0.05)))

Assistance please
0
Comment
Question by:willjx
3 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39961082
Hi,

pls try

IIf([TmsrAmt]![Target]>[Data],IIf([Do we want to see an increase in this Measure?]=True,TmsrAmt]![Target],[Data]-([Data]*0.05)),[Data]-([Data]*0.05))

Open in new window

Regards
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39962157
I'm assuming that this is being used in a query and that:

[Do we want to see an increase in this Measure?]

is actually intended to be an input box or a parameter.  If that is the case, did you declare this parameter as a boolean? If not, you might want to try:

IIf([Do we want to see an increase in this Measure?]="True" And [TmsrAmt]![Target]>[Data],[TmsrAmt]![Target],[Data]-([Data]*0.05)

The IIF() statement in the 2nd part is formatted improperly, it should have three arguments, one that evaluates to True/False and then the value for True, followed by the Value for False.  Yours only has 2 arguments.
0
 

Author Closing Comment

by:willjx
ID: 39962763
After I added a [ after the 1st "True",    (=True,  [TmsrAmt] !)
this solution worked beautifully.
--matched perfectly with results my user provided in Excel.
Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

As freelancing is becoming more and more common in the tech industry, certain obstacles are proving to be a challenge to those who are used to more traditional, structured employment. This article is meant to help identify such obstacles and offer a…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 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