Reputation: 1752
I want to update a DateTime
filed with value like 2008-04-22 00:00:00.000
and add a fixed time to it + 1 Hour
example i have the column like 2008-04-22 00:00:00.000
to be like 2008-04-22 01:00:00.000
thanks
Upvotes: 3
Views: 2242
Reputation: 29
Update DateTime column with 00:00:00
Time - Keep Date unchanged, only time changes
update [EmployeeSchedule]
set [SchedDate] = CONVERT(DATETIME, CONVERT(VARCHAR(50), [SchedDate], 102) + ' 00:00:00')
Upvotes: 1
Reputation: 103338
UPDATE TableName SET ColumnName=DATEADD(hh, 1, ColumnName)
Where TableName
is your table, and ColumnName
is a datetime column
Upvotes: 1