Parameter Date

G

Guest

Iam using a parameter query using Between [Begin_date] and [End_date]
End_date should be inclusive - Correct?
If Yes, When my parameter begin date is 03/28/2007 and end_date is 03/29/2007
It gives all the values from 03/28/2007 and 03/29/2007 to 03/29/1999.
What am I doing wrong? Please help.
Thanks
Pon
 
A

Allen Browne

Sounds like there is some confusion about the data type here.

1. The query is based on a table that has the date field.
Open that table in design view, and check that the field is of type
Date/Time, not Text. (If it is a text sort, you will get the wrong results.)

2. In query design view, choose Parameters on the Query menu.
In the parameter dialog, declare your 2 parameters, so Access knows their
type. The 2 rows will look like this:
Begin_date Date/Time
End_date Date/Time
 
J

John W. Vinson

Iam using a parameter query using Between [Begin_date] and [End_date]
End_date should be inclusive - Correct?
If Yes, When my parameter begin date is 03/28/2007 and end_date is 03/29/2007
It gives all the values from 03/28/2007 and 03/29/2007 to 03/29/1999.
What am I doing wrong? Please help.
Thanks
Pon

Is the field a Date/Time field? My guess is that it's Text and that Access is
applying the "BETWEEN" alphabetically (03/anything comes before 04/anything)
rather than chronologically.

If that's not it, please open the query in SQL view and post the SQL text
here.

John W. Vinson [MVP]
 

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