`

Converting DateDiff to HH:MM:SS

 
阅读更多

Here is an example using backupset.

If I understood what you were asking for this should be it. It outputs the data as datatype TIME.

If you want datetime then replace CAST('00:00:00' AS TIME)) with '1/1/1900'.

 

SELECT database_name, DATEADD(ss,datediff(ss,backup_start_date, backup_finish_date),
CAST('00:00:00' AS TIME))
FROM backupset
GROUP BY database_name

 

http://www.sqlservercentral.com/Forums/Topic1379947-391-1.aspx

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics