How can I use a SQL UPDATE statement to add 1 year to a DATETIME column?

前端 未结 6 1808
难免孤独
难免孤独 2020-12-05 23:27

I want to add 1 year to a datetime-type column in every single row in a table. Adding using an UPDATE statement is easy for numeric types. ex:

UPDATE TABLE S         


        
6条回答
  •  情话喂你
    2020-12-05 23:55

    UPDATE Procrastination SET DropDeadDueDate = DATEADD(year, 1, DropDeadDueDate)
    

    http://msdn.microsoft.com/en-us/library/ms186819.aspx

提交回复
热议问题