Date Criteria

A

aMack

I have created a query which prompts the user to enter [Beg date] and [End
date].

The query compares Dates in the table "Between [Beg date] and [End date]"
but since there are times in the Date field, the End date does not get picked
up.

I assume that [End date] defaults to 12:00AM. If the [End date] input is
changed to 3/1/2006 from 2/28/2006 it picks up the record 2/28/2006.

What changes can I make to the query to include all records in the range?
The range ca be other than Monthly so Month() will not help.

Thanks
 
J

John Spencer

If you wish to continue use a parameter prompt try
= [Beg date] and < DateAdd("d",1,[End date])

In the SQL Where clause that would look like

WHERE SomeDateField >= [Beg date] and SomeDateField < DateAdd("d',1,[End
date])


aMack said:
I have created a query which prompts the user to enter [Beg date] and [End
date].

The query compares Dates in the table "Between [Beg date] and [End date]"
but since there are times in the Date field, the End date does not get
picked
up.

I assume that [End date] defaults to 12:00AM. If the [End date] input is
changed to 3/1/2006 from 2/28/2006 it picks up the record 2/28/2006.

What changes can I make to the query to include all records in the range?
The range ca be other than Monthly so Month() will not help.

Thanks
 
M

Marshall Barton

aMack said:
I have created a query which prompts the user to enter [Beg date] and [End
date].

The query compares Dates in the table "Between [Beg date] and [End date]"
but since there are times in the Date field, the End date does not get picked
up.

I assume that [End date] defaults to 12:00AM. If the [End date] input is
changed to 3/1/2006 from 2/28/2006 it picks up the record 2/28/2006.

What changes can I make to the query to include all records in the range?
The range ca be other than Monthly so Month() will not help.


Use a calulated field in the query:
DateValue(yourdatefield)
and uncheck its Show box.

Apply your criteria to this new field.
 
Top