Solved

IIF And

Posted on 2011-09-24
4
369 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

803 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