Last post Mar 13, 2015 04:38 AM by Krunal Parekh
Mar 12, 2015 08:04 PM|Arial12|LINK
I am in a big troubled. One of the database server did not get time adjustment during the time change. all data entered for the first 30 hours are an hour behind. there are many date time data fields through out the database which are need to be corrected.
does anyone has any suggestion on how to correct all time fields set an hour back?
Mar 12, 2015 08:18 PM|oned_gk|LINK
Something like this
UPDATE TBL SET DateField=DateAdd(hh,-30,DateField) WHERE Id>...
Mar 13, 2015 04:38 AM|Krunal Parekh|LINK
DECLARE @Date DATETIME = '2015-12-03 00:00:00' --We will update records whose date is greater than this date (you need to adjust accordingly)Update dbo.Table
SET DATE = DATEADD(Hour,1,DATE)WHERE DATE > @Date
Have a look at this DateAdd function on how to achieve this.
Hope this helps. Don't forget to take backup of the database before doing this.