1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
CREATE FUNCTION [dbo].[GetDuree]
(
@mstot numeric
)
RETURNS nvarchar(15)
AS
BEGIN
DECLARE @ms int
DECLARE @s int
DECLARE @m int
DECLARE @h int
DECLARE @retour nvarchar(15)
set @h = convert(int,(@mstot / 3600000))
set @m = convert(int,(@mstot % 3600000)/60000)
set @s = convert(int,(@mstot % 60000)/1000)
set @ms = convert(int,(@mstot % 1000))
set @retour = cast(@h as nvarchar) + ':' + cast(@m as nvarchar) + ':' + cast(@s as nvarchar) + ':' + cast(@ms as nvarchar)
RETURN @retour
END |