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; 

the result

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´; 

no return

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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -