I need to get all records those equal and less than 2012-12-28 i used bellow query for this, booking_time is DATETIME field, and there are records less than 2012-12-28 but i
wrap the value with single quote and surely it will work
SELECT * FROM ctx_bookings WHERE DATE(booking_time) <= '2012-12-28' ORDER BY id ASC