View Single Post

  #5 (permalink)  
Old 04-24-2007
macca
 
Posts: n/a
Default Re: URGENT HELP NEEDED PLEASE! Selecting a date range without the year

Well i did, i just didnt show it here. The where clause of the query
is:


WHERE (MONTH(PurchaseDate) BETWEEN #form.txtStartMonth# AND
#form.txtEndMonth#) AND (DAYOFMONTH(PurchaseDate) BETWEEN
#form.txtStartDay# AND #form.txtEndDay#) AND (YEAR(PurchaseDate)
BETWEEN #form.txtStartYear# AND #form.txtEndYear#) ORDER BY
PurchaseDate ASC

With each of DAYOFMONTH,MONTH & YEAR only being concatenated to the
where clause if the user sets one in the form


But you are right.This does not work when month1 is November and
month2 is January. I didnt even think of this


suggestion appreciated...


Reply With Quote