count decimal place

S

samuel

I want to query a field for more than 3 decimal places.

A
..23
1.56
49.34534
7.434

I want 49.34534 to be the only result. Any thoughts?
 
D

Douglas J. Steele

SELECT MyField
FROM MyTable
WHERE (Len(MyField) - InStrRev(MyField, ".")) > 3
 
S

samuel

I get Data type mismatch in criteria expression.

However this field on my table is designated a 'number' type
 
K

KARL DEWEY

Try this ---
SELECT MyField
FROM MyTable
WHERE (Len([MyField]) - InStrRev(Str([MyField]), ".")) > 3
 
J

Jamie Collins

this field on my table is designated a 'number' type

Try this ---
SELECT MyField
FROM MyTable
WHERE (Len([MyField]) - InStrRev(Str([MyField]), ".")) > 3

Do you usually cast as text when you round numeric values?! What if
Regional Settings have a different decimal point character?

Alternative suggestion:

SELECT MyField
FROM MyTable
WHERE MyField <> (FIX(MyField * 1000) * 0.001)

Jamie.

--
 
Top