Reputation: 33
I have a select statement that is finding all the dates in the column that are on the 9th of the month, regardless of month and year:
SELECT *
FROM tblhosting
WHERE DAY( nextduedate ) =09
I would like to UPDATE the DAY to 10, but leave the month and year alone.
Any help?
Upvotes: 3
Views: 93
Reputation: 263693
UPDATE tableName
SET nextduedate = DATE_ADD(nextduedate,INTERVAL 1 DAY)
WHERE DAY(nextduedate) = 9
Source:
Upvotes: 4