Date range.

New2SQL

Registered User.
Local time
Today, 09:02
Joined
Apr 15, 2005
Messages
19
I am trying to get a date range for my query. I need my query to be able to input 2 date sets and pick data between the dates.

At the moment i can add on the date using the [date dd/mm/yy] and also using the >= to show info based after this date, but need to have the information between two dates.

any idea?
 
In the criteria of the Date field put this

Code:
Between [Enter Start Date] and [Enter End Date]

Col
 
thanks for that.

works a dream.
 
ColinEssex said:
In the criteria of the Date field put this

Code:
Between [Enter Start Date] and [Enter End Date]

Col
I've got a similar problem, only I'm getting the To and From dates from a form. What's kicking my butt is the fact that my query is not returning the To dates. In other words, it's querying the From date inclusively and the To date exclusively so my query never returns any data for the To date, just everything up to that date.

Code:
Between [Forms]![F_Print_Select]![txtFrom] And [Forms]![F_Print_Select]![txtTo]
 
Frank,
I'm guessing your field your querying against has a time element in it. Something like:

04/19/05 10:35 ... or something like

So, when you compare 04/19/05 against it, the above is actually greater than 04/19/05, because 10 hours and 35 minutes has elapsed.

You can do one of two things, format the field to a Short Date and then have your criteria on that, or add a day to your criteria:

Between [Forms]![F_Print_Select]![txtFrom] And Dateadd("d",1,[Forms]![F_Print_Select]![txtTo])
 

Users who are viewing this thread

Back
Top Bottom