Looking up by dates in a range

  • Thread starter Thread starter BigBlueMan
  • Start date Start date
B

BigBlueMan

I have a database of activities that take place between a start date and an
end date.

How do I arrange a query so that I can get all the activities that take
place BETWEEN two dates? (ie.. Say I want a report from January 1 thru
June 30. It might include an item that starts on February 1, and ends March
15)

If I put in 01/01/04 as the start, it is an absolute and would not pick up
this event.

Thanks!

ed
 
BigBlueMan said:
How do I arrange a query so that I can get all the activities that take
place BETWEEN two dates? (ie.. Say I want a report from January 1 thru
June 30. It might include an item that starts on February 1, and ends
March 15)

What prohibits you from using something like "queryStart <= startDate AND
endDate >= queryEnd"?

Anno.
 
Try a parameter with the between function. Btween [Enter Start Date] and [Enter End Date] in the criteria.
 
I had the same problem the only solution I found was to have the requester place the day before and the day after.
Example if you need information from 01-01-04 through 01-31-04 they quiered 12-31-03 then 02-02-04...until I find another way this seem to solve the problem, as long as you are using the between expression.

Regina
 
Usually this would mean that your dates also had a time attached. And often
that comes about when people use the NOW() function which includes the time
rather than using the Date() function which doesn't include the time (well, it
does but the time is always exactly midnight).

IF that is causing the problem and you are using parameters you can do
= [Start Date:] and < DateAdd("d",1,[End Date])

or

Between [Start Date:] and DateAdd("s",86399,[End Date:])

That is one second before midnight on the specified End Date
 
Back
Top