Query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top