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.

enter image description here

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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -