DateDiff and then SUM
DateDiff and then SUM
(OP)
Hi
I have used the below code to calculate the difference between 2 datetime fields. The result is in seconds but I would like it to display hours and minutes and seconds if possible. I have tried SUM and also converet with just Time instead of datetime. Any ideas please
DATEDIFF(MINUTE,CONVERT(DATETIME,dbo.WTTReportHeader.StartTime,101),CONVERT(DATETIME,dbo.WTTReportHeader.EndTime,101)) as Timediff
I have used the below code to calculate the difference between 2 datetime fields. The result is in seconds but I would like it to display hours and minutes and seconds if possible. I have tried SUM and also converet with just Time instead of datetime. Any ideas please
DATEDIFF(MINUTE,CONVERT(DATETIME,dbo.WTTReportHeader.StartTime,101),CONVERT(DATETIME,dbo.WTTReportHeader.EndTime,101)) as Timediff

RE: DateDiff and then SUM
CODE
Borislav Borissov
VFP9 SP2, SQL Server
RE: DateDiff and then SUM
Thanks for the post, I was trying to use your code from the previous post but could not quite get it right with the convert and then the datediff.
Your line of code worked first time so thank you for your help, really appreciated.