sql - Why I cannot compare date using ">" in MySQL? -
i using mysql filter date according creationdate.
if did without comparing creationdate, return results.
use todo; select * todoitem todolistid = 1 , completed = 1 , priority>=2;
however, when add comparison date, there no result.
use todo; select * todoitem todolistid = 1 , completed = 1 , priority>=2 , creationdate > ´2004-11-18 15:26:58´;
it says there "sql syntax error near '15:26:58' " , "query interrupted".
i not why not work because saw examples on stackoverflow using ">" , "<" compare 2 date directly.
any appreciated. thank you.
use single quotes ('
) instead of backticks (`), query should be:
use todo; select * todoitem todolistid = 1 , completed = 1 , priority>=2 , creationdate > '2004-11-18 15:26:58';
Comments
Post a Comment