Solved

IIF Function based on a Value and a Calculation

Posted on 2013-07-01
5
361 Views
Last Modified: 2013-07-02
I have two fields; One that has a static number from a linked report and the other which I created based on Calculations from two other fields.

I created a IIF Statement:  Odd Match: IIf([Speed 1]=[Speed 2],1,0)

Speed 1 is the static number and Speed 2 is the calculated field based off of two other fields.

They are all set as numbers, yet they are not agreeing.

Do you have any suggestions of what I should look for?

Feeling a little dumb right now...
0
Comment
Question by:ammiewinds
[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
  • 2
  • 2
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39291449
this is just a test to see if your expression works

 Odd Match: IIf(Int([Speed 1])=Int([Speed 2]),1,0)
0
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39291477
Depends on your calculations and the datatypes of the static number and the computed value.  If they are double or single precision numbers, there could be some rounding error in the computed value.  If that is the case, you might want to try:

Odd Match: IIF(Abs([Speed 1] - [Speed 2]) < .01, 1, 0)

This would check to see if the values are within 0.01 of each other.  Rounding error generally occur deep below the decimal point, so you might want to replace .01 with .0000001 or something like that.
0
 

Author Comment

by:ammiewinds
ID: 39291514
Hi Cap,
Sorry, the integer did not work. :-(

Hi Fryed,
Fantastic!  Thank you so much.

Thank you both for the prompt reponses.

Have a marvelous day!
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39291875
That's "fyed", not "Fryed".  LOL

Glad to help
0
 

Author Comment

by:ammiewinds
ID: 39294211
LOL  Sorry.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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