|
dupati1 -> SQL query by Date- Problems (10/8/2003 13:13:52)
|
Hi All, How can I retrieve the data based on the date. I need to retrieve all the records newer than the date 2003-09-30; I used SELECT * FROM vw_Absence_Report WHERE StartDate > '2003-09-30'; //vw_Absence_Report is a view formed by using other tables of the database But doesnt work: I get this error message: Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E14) Incorrect syntax near the keyword 'Where'. /departments/human_resources/employee_absence/admin/reportgenerator.asp, line 61 The StartDate column in the SQL Server table has the values of the form YYYY-MM-DD 00:00:00:000. I mean it’s a datetime field. I also tried other variations of SQL query like: SELECT * FROM vw_Absence_Report WHERE StartDate > #2003-09-30#; SELECT * FROM vw_Absence_Report WHERE StartDate > '2003-09-30 00:00:00.000'; SELECT * FROM vw_Absence_Report WHERE StartDate > #2003-09-30 00:00:00.000#; But none of them worked. Any suggestions?? VJ
|
|
|
|