Friday, May 15, 2015

How to update year only in a date datatype

In some cases you may need to update your date value in database by changing the date from year to another Ex. updating your dates from year 2014 to 2015

SQL update datetime year only

This way is very simple:

UPDATE TableName SET [Date Column] = DATEADD(YEAR, 1, [Date Column]);

That's it !