Solved

IIF Function based on a Value and a Calculation

Posted on 2013-07-01
5
356 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 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
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
Comment Utility
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)
Comment Utility
That's "fyed", not "Fryed".  LOL

Glad to help
0
 

Author Comment

by:ammiewinds
Comment Utility
LOL  Sorry.
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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

772 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

16 Experts available now in Live!

Get 1:1 Help Now