Solved

IIF And

Posted on 2011-09-24
4
367 Views
Last Modified: 2012-05-12
I know there is probably a simple answer to the below, but I can not get this to run correctly

DstNfin: IIf([DISTANCE]<([DSTFUR]+1.01 And [DISTANCE]>([DSTFUR]-1.01)),[RWNF],0)

What I want is if Distance is between Dstfur plus or minus 1.01 to return RWNF.  If not it would reutrn 0.    For example, DISTANCE is 8 and DSTFUR is 6, would return 0.  If DISTANCE was 8 and DSTFUR is 7, would return RWNF.
0
Comment
Question by:JackJackson54
  • 3
4 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 36592161
Try this:

DstNfin: IIf([Distance] BETWEEN [DSTFUR] - 1.01 AND [DSTFUR] + 1.01, [RWNF],0)

0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 36592165
Parentheses to make it clearer:

DstNfin: IIf([Distance] BETWEEN ([DSTFUR] - 1.01) AND ([DSTFUR] + 1.01), [RWNF],0)

0
 

Author Closing Comment

by:JackJackson54
ID: 36592171
Thank you as that worked.  I tried between late last night and it did not work as I was doing something wrong
0
 
LVL 61

Expert Comment

by:mbizup
ID: 36593165
Glad to help out.

One thing I have found helpful in getting the syntax of these logical statements is to get them out of my head and into writing (pseudocode), and working from there.

Your original post here came very close to speling out the correct syntax :)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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

14 Experts available now in Live!

Get 1:1 Help Now