mysql - SQL DATE not generating correct result with NOW() or CURRENT_DATE() -
sql:
select * `ec_assessment_item` `ec_assessment_due_date` <= now()
sql:
select * `ec_assessment_item` `ec_assessment_due_date` <= current_date()
i want shows data before due date, , tested few method including now() , current_date() empty result.
expected result should id: 2 , 3.
for , currentdate output example
now() : 2017-03-28 14:27:45
currentdate() : 2017-03-28
now() datetime format (y-m-d h:m:s)
curdate or currentdate date format (y-m-d)
you can run script select now(),current_date() ;
this should work. tested on side , works
select * ec_assessment_item ec_assessment_due_date < current_date() ;
sign of strict inferiority mean before
also current date 2017-03-28 output should empty said before today
add table row ec_assessment_due_date = 2017-03-27. result wont empty anymore.
Comments
Post a Comment