更新时间:2022-12-09 13:35:37
请参阅下文回答: -
see the below answer:-
SELECT datediff(Minute,'2006-11-10 05:47:53.497','2006-11-10 08:48:10.420')
还查看以下链接帮助你
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74746 [ ^ ]
http://msdn.microsoft.com/en-us/library/ms189794.aspx [ ^ ]
select
convert(varchar,datediff(hh,convert(datetime,[record time]) ,convert(datetime,[unload time]) ))
+ ':' +
convert(varchar,datediff(mi,convert(datetime,[record time]) ,convert(datetime,[unload time]) )%60)
+ ':' +
convert(varchar,datediff(ss,convert(datetime,[record time];) ,convert(datetime,[unload time]) )%60)
as Duration
From YourTable
快乐编码!
:)
Happy Coding!
:)