Can somebody tell me please why this command throws me an error if there is LIKE clasue on datetime? Here is the code:
UPDATE surveys
LEFT JOIN tasks ON surveys.task_id = tasks.id
SET surveys.ended = tasks.date_to_resolve
WHERE tasks.date_to_resolve LIKE '2018-01%' AND surveys.ended LIKE '2018-02%'
It throws the error "Incorrect datetime value: '2018-01%' for column 'date_to_resolve' at row 1" The strangest thing is the SELECT statement works well with the same condition
SELECT * FROM surveys
LEFT JOIN tasks ON surveys.task_id = tasks.id
WHERE tasks.date_to_resolve LIKE '2018-01%' AND surveys.ended LIKE '2018-02%'