Zeitwerte addieren
SET NOCOUNT ON
CREATE TABLE #temp_table
(
hm VARCHAR(5)
)
INSERT #temp_table VALUES('8:30')
INSERT #temp_table VALUES('5:01')
INSERT #temp_table VALUES('12:59')
INSERT #temp_table VALUES('7:20')
SET NOCOUNT OFF
SELECT
CONVERT(VARCHAR, SUM(DATEDIFF(ss, '1900-01-01 00:00', CONVERT(DATETIME, hm)))/3600) +
':' +
CONVERT(VARCHAR, (SUM(DATEDIFF(ss, '1900-01-01 00:00', CONVERT(DATETIME, hm)))%3600)/60)
FROM
#temp_table
DROP TABLE #temp_table
-------------------------------------------------------------
33:50
(1 row(s) affected)
| Print article | This entry was posted by Frank Kalis on 13.07.04 at 20:30:51 . Follow any responses to this post through RSS 2.0. |
Noch kein Feedback
Einen Kommentar hinterlassen
Trackback-Adresse für diesen Eintrag
http://www.insidesql.org/blogs/htsrv/trackback.php?tb_id=1112
