Solved Query criteria between two hour/decimal numbers

oxicottin

Learning by pecking away....
Local time
Today, 10:11
Joined
Jun 26, 2007
Messages
889
I cant get a correct result in my query. I have a field (DelayHours) and I don't want to display anything that's in the range of 9.75 to 14.17. I tried

<"9.75" Or >"14.17"

As my criteria and I still get the results including numbers in that range. The only thing that works but does me no good in a range of numbers is...

Not In ("9.75", "9.83", "14.17")


But that only blocks those numbers. Thoughts?
 
Not (Between 9.75 And 14.17)
 
They are numbers and should not be processed as text.

Any comparison must be a complete expression.
Code:
WHERE DelayHours < 9.75 OR DelayHours > 14.17

This is another expression that would do it.
Code:
WHERE NOT DelayHours BETWEEN 9.75 AND 14.17
 
Last edited:
Also beware of performing any arithmetic or comparisons on floating point numbers. The small errors representing floating point in binary can cause unexpected results.

For example, the answer to the following expression can be quite surprising. (Type it in the immediate window of VBA and press Enter)
Code:
? 0.7 * 90 = 63
 

Users who are viewing this thread

Back
Top Bottom