I have a date 2013-12-14 05:00:00.000 in my table.
Now i want to update only time of that date. E.G to 2013-12-14 04:00:00.000
Is there any query to update o
DECLARE @Time as TIME; DECLARE @Date as DATETIME; SELECT @Time = CONVERT(TIME, '2016-01-01 09:30:00.000'); SELECT @Date = CONVERT(date, GETDATE()); --2017-03-10 16:37:34.403 SELECT DATEADD(MINUTE, DATEPART(MINUTE, @Time), DATEADD(HH, DATEPART(HOUR, @Time), @Date))
OUTPUT: 2017-03-10 09:30:00.000