View Single Post
  #7  
Old May 13th, 2010, 12:44 AM posted to microsoft.public.access.queries
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Query and date selection

Try a query like this:

SELECT *
FROM Reservations
WHERE StartDate DATE()
AND FORMAT(StartDate, "mmdd")
NOT BETWEEN "0401" AND "1114";

This works by excluding future dates outside the range rather than including
those within it.

Ken Sheridan
Stafford, England

Chrissy wrote:
Thanks, John.

I test on the StartDate, future only. So I entered...

Date() And (DateSerial(Year([StartDate]),4,1) Or DateSerial(Year([StartDate]),11,15))


This resulted, like what I was using, current year only.

What do I do about all future dates falling in this range in any future
year?

Thanks,

I test to see if a reservation begins between 11/15-3/31 of any year.

[quoted text clipped - 16 lines]
DateSerial(Year(Date()), Month([reservationdate]), Day([reservationdate]))
BETWEEN #1/1# AND #3/31#;


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1