Query?

M

Metalteck

I'm trying to perform a query with a number such as 521.00 as my criteria
field.
But unfortunately, 521.00 is too narrow for my results, I need to be able to
look up all records that begin with 521. The last 2 digits can be very
numerous.

Please help.
 
D

Douglas J Steele

Try either

WHERE Int(MyNumber) = 521

or

WHERE MyNumber BETWEEN 521 AND 522

If you're using a parameter to provide 521, rather than hard coding it, that
would be

WHERE Int(MyNumber) = [What Number?]

or

WHERE MyNumber BETWEEN [What Number?] AND [What Number?] + 1


If you've got a large number of records, you'll find the second one should
be faster, as it doesn't need to apply the function to each row in the
table.
 
Top