Solved

MS ACCESS 2007 syntax on ACCESS:  IIF/Or statement

Posted on 2014-03-27
3
571 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

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 48

Expert Comment

by:Dale Fye
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

623 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