Date Criteria

G

Guest

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.
 

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