Hi I am trying to query records in a sql database based on a date and time column. I want to select all records that are past a specific date. Here is what I tried.
SELECT * FROM `table` WHERE status = 1 AND odate >= ? AND otime > ?;
Which this will not work because even if the date value is greater the time has to be greater as well. I am not sure how this can be done? I am using MS SQL.
Here is test case...
DB Record || odate: 12/20/2013 otime: 4:55:00 PM.
Passed Params || date: 12/15/2013 time: 6:13:00 PM
Even though the odate > date the otime is not > than time.
So my query,
AND odate >= ? AND otime > ?;
fails.