Solved

IIF And

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

631 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