How do I specify a date range in MS Access? Is the below query correct? Do I have to put \"2/1/2010\"
in quotes? Or do I have to do something like date(2/
The dates to use in select (in Microsoft) are defined as: "#"+month+"/"+day+"/" +year+"#"
the field day is a number 01,02---,31
the field month is a number 01,02 ...12
the field year is 2014, 2015 ...etc
you can build the SQL field dinamically
es. in vbscript
dt1="#"&month(date1)&"/"&day(Date1)&"/"&year(Date1)&"#"
dt2="#"&month(date2)&"/"&day(Date2)&"/"&year(Date2)&"#"
and then you can use the select in a field SQL
where the table Orders has a field named OrderDate es.
SQL="select * from Orders where OrderDate Between " & dt1 & " and " dt2
now you can access the Database