JohannIcon
Programmer
Dear All,
I am trying to search for all the records that are between today's date and exactly last year, ie between 8/25/2003 and 8/25/2002. I have this sql which is not working:-
curDate = date()
diffDate = (DateAdd("yyyy",-1,date()))
sqlReading = "SELECT * from xermeter WHERE (machine_ref = '" & RefCode & "' AND date_col BETWEEN '" & diffDate & "' AND '" & curdate & "' ORDER BY Date_Col DESC"
The error is the following:-
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Error In Expression. = 'DB0030' AND date_col BETWEEN ( '8/25/2002' , '8/25/2003' ) << Syntax Error >> ORDER BY Date_Col DESC
What I am doing wrong?
Thanks for your help and time
I am trying to search for all the records that are between today's date and exactly last year, ie between 8/25/2003 and 8/25/2002. I have this sql which is not working:-
curDate = date()
diffDate = (DateAdd("yyyy",-1,date()))
sqlReading = "SELECT * from xermeter WHERE (machine_ref = '" & RefCode & "' AND date_col BETWEEN '" & diffDate & "' AND '" & curdate & "' ORDER BY Date_Col DESC"
The error is the following:-
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Error In Expression. = 'DB0030' AND date_col BETWEEN ( '8/25/2002' , '8/25/2003' ) << Syntax Error >> ORDER BY Date_Col DESC
What I am doing wrong?
Thanks for your help and time