Why is 300.00 greater than 300

M

mscertified

I have 2 controls both have property 'General number' and decimal places
'Auto'. One contains 300 and the other 300.00. When I do a 'greater than'
check in conditional formatting, it flags 300.00 as greater than 300. Why is
this and how to fix it ???
 
D

Douglas J. Steele

<picky>
Actually, you want to do something like Abs(A-B) < 0.001
</picky>
 
M

Marshall Barton

mscertified said:
I have 2 controls both have property 'General number' and decimal places
'Auto'. One contains 300 and the other 300.00. When I do a 'greater than'
check in conditional formatting, it flags 300.00 as greater than 300. Why is
this and how to fix it ???


If the "numbers" are stored in Text fields in their table,
they will be sorted in alphabetical order.

There are also times when a query will convert an numeric
table field to Text, especially if the query field is
calculated.

You can check for this situation by using the appropriate
conversion function in your comparison, e.g. CDbl(f1) >
CDbl(f2)
 
Top