Incorrect date value in update query

Hello everyone.

Really I don’t understand this error in update query MySQL:

UPDATE
_myTable R 
LEFT JOIN _yourTable C ON C.myNumber = R.yourNumber 
SET R.yourOff = 1 
WHERE (C.myLastDate <> '' OR C.myLastDate IS NOT NULL)

Incorrect date value: '' for column 'myLastDate' at row 1

I don’t have null value of field ‘myLastDate’ in the _myTable.

I hope your help.

You can’t insert ’ ’ into a date column so you can’t compare it to an empty string. If you do you will end up with a warning or error message.

Thanks :wink: