I'm trying to update one datetime field based on other datetime filed that is bigger than 1 day than the other
This is my query:
UPDATE TABLE SET `field`='amyvalue' WHERE datetime_field < GET_FORMAT(UNIX_TIMESTAMP(`other_datetime_field`)-86400, 'ISO')
I'm getting this error:
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(`other_datetime_field`)-86400, 'ISO')' at line 1
How can I use GET_FORMAT() to get it to work properly ?