ok, I'm trying to select a date range (particular month and year). [FONT=Verdana, Arial, Helvetica]here's my date range comparison. it's working for months but not years - anyone got any ideas? i'm calling the query from an asp.net page
"SELECT orderNum, orderDate, bName, bCompany, orderStatus FROM tblOrderAddr WHERE (format(orderDate, 'mm/dd/yyyy hh:min:ss') >= format(" & date1 & ", 'mm/dd/yyyy hh:min:ss')) AND (format(orderDate, 'mm/dd/yyyy hh:min:ss') <= format(" & date2 & ", 'mm/dd/yyyy hh:min:ss')) and orderStatus <> 'Completed'"
date1 and date2 are strings i pass in and they look like this if i'm searching for something from april 2010
#04/01/2010# #04/30/2010#[/FONT]
"SELECT orderNum, orderDate, bName, bCompany, orderStatus FROM tblOrderAddr WHERE (format(orderDate, 'mm/dd/yyyy hh:min:ss') >= format(" & date1 & ", 'mm/dd/yyyy hh:min:ss')) AND (format(orderDate, 'mm/dd/yyyy hh:min:ss') <= format(" & date2 & ", 'mm/dd/yyyy hh:min:ss')) and orderStatus <> 'Completed'"
date1 and date2 are strings i pass in and they look like this if i'm searching for something from april 2010
#04/01/2010# #04/30/2010#[/FONT]