Sql statement and dates.
-
i'm having a little problem with dates in sql when i try to get a open a recordset in mfc (ado) here is my sql statement: SELECT * FROM error WHERE date_open < 22/04/00 AND date_close <> null AND date_open - 22/04/00 <= -7 date_close and date_open are both date fields and i'm trying to get some data which is 7 days old and not yet been closed. thanks,
-
i'm having a little problem with dates in sql when i try to get a open a recordset in mfc (ado) here is my sql statement: SELECT * FROM error WHERE date_open < 22/04/00 AND date_close <> null AND date_open - 22/04/00 <= -7 date_close and date_open are both date fields and i'm trying to get some data which is 7 days old and not yet been closed. thanks,
Enclose your date literals with "#"'s. eg: WHERE date_open < #22/04/00#