Criteria Question

G

Guest

*I'm not very knowledgeable with Access*

I want to input a criteria for a query with a range of results, some are all
numerical and some contain letters. How do I create a range criteria for
example "11111 to 33333" or "H12345 to H23456"? The only way i have been able
to do it is very confusing, for instance I use Like
"[1-3][1-3][1-3][1-3][1-3]", which can produce the results but I'm not sure
if there is a better input strategy.
 
G

George Nicholson

You can use Between with Criteria:

Between 11111 and 33333 (if a numeric field)
Between "H12345" and "H23456" (if a text field)

Between is inclusive, so records matching the specific values above would be
included.
However, be careful when using it with dates. Since Date values also include
Time, something like
Between #06/21/06# and #06/21/07#
would exclude records with values greater than 6/21/07 12:00:00 AM. If time
values are stored in the data, that probably means the entire day would be
excluded.

HTH,
 
G

Guest

Ok great, I have an access book and it didnt mention that!!!

George Nicholson said:
You can use Between with Criteria:

Between 11111 and 33333 (if a numeric field)
Between "H12345" and "H23456" (if a text field)

Between is inclusive, so records matching the specific values above would be
included.
However, be careful when using it with dates. Since Date values also include
Time, something like
Between #06/21/06# and #06/21/07#
would exclude records with values greater than 6/21/07 12:00:00 AM. If time
values are stored in the data, that probably means the entire day would be
excluded.

HTH,


Florida Analyst said:
*I'm not very knowledgeable with Access*

I want to input a criteria for a query with a range of results, some are
all
numerical and some contain letters. How do I create a range criteria for
example "11111 to 33333" or "H12345 to H23456"? The only way i have been
able
to do it is very confusing, for instance I use Like
"[1-3][1-3][1-3][1-3][1-3]", which can produce the results but I'm not
sure
if there is a better input strategy.
 

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

Top