Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Between function in query criteria...

Status
Not open for further replies.

Crevalle

Technical User
Aug 16, 2004
36
0
0
US
I have dates in the format of "8/2/2004 10:51 PM" in my tables. I would simply like to allow the user to input two dates, and be able to pull all records within the date range. Here's the odd thing: using "Between [enter beg date] and [enter end date]" does not work. For some reason, it works when I input ">=8/2/2004 and <=9/14/2004"

Is there a way to do this better, or to add the wildcards (>=/<=) to my query? I tried "Between "<=" & [enter beg date] and "<=" & [enter end date]" to no avail.

Thanks--I will be watching for responses!
 
FWIW--The standard "between [enter beg date] and [enter end date] brings back all dates EXCEPT the current date. For example, if I put 8/1/2004 to 9/14/2004, it will pull back all date from 8/1/2004 to 8/13/2004. When I use the >=/<=, it does the same thing. However, if I put 8/1/2004 to 8/15/2004, it will pull back 8/14/2004 records successfully.

This should be so easy, I'm almost embarrassed...
 
Looks like my problem lies in the fact that my dates have times associated. So, my query is searching for records UP TO 09/14/2004 @ 12:00am.

Can anyone recommend a way around this?
 
most of the people who read the Access SQL forum also read the Access Other topics forum.

Please do not double post. The "answer" you are showing:
Looks like my problem lies in the fact that my dates have times associated. So, my query is searching for records UP TO 09/14/2004 @ 12:00am.

I believe came from information that I posted in your other thread where there are already two other suggestions.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top