Reputation: 13
I have a table in SQL Server with a column called "CreatedDate" (type: DateTime). I want to update all records by adding 3 hours to existing value. All rows are created on a different DateTime. If a record was created at 07:33 then after running the query it should have value 10:33.
Upvotes: 0
Views: 614
Reputation: 521794
Use DATEADD
:
UPDATE yourTable
SET CreatedDate = DATEADD(hour, 3, CreatedDate);
Upvotes: 1