Solved

MS ACCESS 2007 syntax on ACCESS:  IIF/Or statement

Posted on 2014-03-27
3
565 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 51

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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

734 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