Solved

IIF Function based on a Value and a Calculation

Posted on 2013-07-01
5
358 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
  • 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 47

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 47

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

809 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