我有以下查询
MERGE Time_Tracker AS target
USING
(SELECT
USERID,
SUM(DATEDIFF(MINUTE, '19000101', TotalBreakTime)) / 60 AS ColumnWithBreaksCount
FROM BreaksTable
WHERE CONVERT(date, StartTime) = CONVERT(date, GETDATE())
GROUP BY USERID) AS source
ON target.USERID = source.USERID
WHEN MATCHED THEN UPDATE
SET BREAKS = source.ColumnWithBreaksCount;
此处我得到的输出在我的休息栏中为0
,但时差为10
秒,当我将DATEDIFF(minute, '19000101', TotalBreakTime)/60
更改为DATEDIFF(second, '19000101', TotalBreakTime)
时,它显示我我10
中的Breaks column
。在这里,我想显示两分钟后跟秒的时差(如0.10
),我的中断列为float
类型。
请让我知道我该怎么做。
以下是我的结果表
由于