user1825276
user1825276

Reputation: 33

Update Day of Month

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

Answers (1)

John Woo
John Woo

Reputation: 263693

UPDATE tableName
SET nextduedate = DATE_ADD(nextduedate,INTERVAL 1 DAY) 
WHERE DAY(nextduedate) = 9

Source:

Upvotes: 4

Related Questions