我希望输出为:--11:25
,但在几分钟内得到-685
select ClientName, JobName, JobTime, FileWriteTime,
CAST(FileWriteTime as time(0))[Time],
(DATEDIFF(MINUTE,CAST(FileWriteTime as time(0)),
CONVERT(datetime,JobTime,120))) as Minutes
from StaleFileReport
where ClientName ='AIA' and JobName ='MY-PTACOMB-TRD-LD' and convert(varchar,ReportTime,102)
in ('2018.09.03','2018.09.10','2018.09.17','2018.09.24') order by convert(varchar,ReportTime,102)**
答案 0 :(得分:0)
如下更改查询
select ClientName, JobName, JobTime, FileWriteTime,
CONVERT(VARCHAR(5),FileWriteTime,108) HourMinute
from StaleFileReport
where ClientName ='AIA' and JobName ='MY-PTACOMB-TRD-LD' and convert(varchar,ReportTime,102)
in ('2018.09.03','2018.09.10','2018.09.17','2018.09.24') order by convert(varchar,ReportTime,102)