date time field
I've got 2 x sql statements - the first one I want to pull out records between certain date ranges, the second I want to pull out records after their end date has passed.
This is what I've got set up for pulling out the records between certain date ranges:
SELECT * FROM tbl_tenders t WHERE t.startdate <= 21/07/2012 AND 21/07/2012 <= t.enddate AND IsLive = 0 ORDER BY t.startdate DESC
For the records whose enddate have passed I have:
SELECT * FROM tbl_tenders t WHERE 21/7/2012 > t.enddate
the enddate field I have in the database is a datetime field written such as: 2012-07-19 00:00:00.000 though not sure this should make any difference
What's happening is that all the records are being shown using the first sql statement regardless of the date
can any one advise?