Can I know what is wrong with my sql statement below. I gives an error "incorrect datetime value".
UPDATE stocks SET Notes = '0' where ExpireDate like '%2017-12-28%' and StockCount > 0;
Can I know what is wrong with my sql statement below. I gives an error "incorrect datetime value".
UPDATE stocks SET Notes = '0' where ExpireDate like '%2017-12-28%' and StockCount > 0;
Try this:
SET sql_safe_updates = 0;
UPDATE STOCKS
SET NOTES = '0'
WHERE EXPIREDATE = CURDATE()
AND STOCKCOUNT > 0;
SET sql_safe_updates = 1;