Between Function (with dates)

G

Guest

I have typed the following criteria in a query:

Between [1/1/2005] And [1/31/2005]

When I run the query and enter the data, it returns this error:

"This expression is typed incorrectly, or it is too complex to be evaluated."

This is not complex at all. What am I doing wrong?
 
F

fredg

I have typed the following criteria in a query:

Between [1/1/2005] And [1/31/2005]

When I run the query and enter the data, it returns this error:

"This expression is typed incorrectly, or it is too complex to be evaluated."

This is not complex at all. What am I doing wrong?

If you are going to hard code the dates, you need to wrap them within
the date delimiter #.

Between #1/1/2005# And #1/31/2005#

If you want to be prompted for the dates, then you use:

Between [Enter Start Date] And [Enter End Date]

All the above pre-supposes the field is a Date datatype.
 
G

Guest

Hi,
do you want a parameter query to come up with two input boxes? Then you
should use:

BETWEEN [Enter Start Date:] AND [Enter End Date:]

If you want to just hardcode two dates then use:

BETWEEN #1/1/2005# And #1/31/2005#
HTH
Good luck
 
G

Guest

Try
Between #1/1/2005# And #1/31/2005#

Or, if you want to prompt the user to enter start and end date
Between [Please enter start date:] And [Please enter end date:]
 

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