Query Date Range

Crispy

Registered User.
Local time
Today, 21:50
Joined
May 28, 2002
Messages
43
I have a query which requires date parameters, which the user enters into a form. The form enters the parameters into 4 different queries then runs them to produce a report.

This all works fine EXCEPT for one query.

If I enter my desired date range into the query (in this case it is between 01/11/2004 and 30/04/2005) it returns no results. As the only values in the date fields of the table are 01/03/2005 and 01/04/2005 it should return all the records.

However if I enter the date range between 01/01/2005 and 30/04/2005 it works fine. It also works if I enter 01/01/2000 and 31/05/2005 - it just doesn't seem to like the year 2004!!!

The problem occurs whether I enter the parameters from the form or simply type them into the criteria of the query. Any ideas, it's driving me nuts!!
 
If you place an entry for the year 2004, does your Start and Stop date work for the year 2004?

1/1/2004 - 1/1/2005
 
Can't tell. If I do that it returns no results, which is correct. But it is also returning no results in scenarios where I would expect to see records returned. Weird!
 
Can you paste the SQL code, or your VB code that calls the Query?
 
My guess is that the dates are treated as being dates in US date format.
Check the Regional Settings on your PC, do they happen to be set to MM-DD-YYYY format?

RV
 

Users who are viewing this thread

Back
Top Bottom