我有这样的日期和时间列:
我要添加Time4 + 11:00 hours = 00:53:27:967 + 11:00:00 = 11:53:27:967
然后将其附加到Time1
列的时间戳记中
2018-10-19 11:53:27:967
。
下面是我遵循的过程:
-- Step 1 Trim the Time1 to display only the date
SELECT time1, time4, LEFT(CAST(Time1 AS DATETIME2), LEN(time1) - 9) AS Time5
FROM table1
并获得以下输出:
--Step 2 Add Time4 + 11
SELECT time4 + '11:00:00.0000000' AS Time6
FROM DU_GPSTime_2
我在上述步骤中失败。
如果固定了步骤2,最后一步看起来很简单。
--Step 3 Combine time5 + time6
SELECT time7 = time5 + time6
FROM table1