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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query on date Question 1

Status
Not open for further replies.

Wrecker

Technical User
Aug 29, 2001
126
US
I have the criteria set for: Between [Start Date] and [End Date] in the Date field of a query. If I punch in 01/15/03 for the Start Date, and 01/16/03 for the finish Date, it works fine. How would I write the Criteria for a single day?

If I set the criteria for: Like [Date] and punch in 01/15/03, I get no data. Also If I have the criteria set for: Between [Start Date] and {End date], and use the same date for both, I get no data.

Thanks
Wrecker
 
= [date]

is probably too simple
"What a wonderfull world" - Louis armstrong
 
Rather than:
Between [StartDate] And [EndDate]

you might try:
>= [StartDate] And <= [EndDate]

as the criteria for your query -- which should allow you enter the same date for [StartDate] and [EndDate] and consider that date inclusively.

Hope this helps,
sshowers
 
The reason you get no data when you use the same DATE for your criteria is that a DATE guy carries along with it a TIME component.

If no time is entered, a DATE field defaults to MIDNIGHT of the date given.

Thus, your query was looking for records between xx/xx/xx 00:00:00 (e.g., Midnight) and xx/xx/xx 00:00:00 (also midnight.) Zero Hours, Zero Minutes, and Zero seconds is a relatively short time span for events to happen within. Thus, no data.


Jim
Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top