tsql - How do I convert number of minutes to interval in SQL Server? -
i have duration column of type time(7) in appointments table.
i know how number of minutes in appointment using
select durationminutes = datediff(n, a.starton, a.endon) appointments but duration column time(7).
how convert int duration?
declare @time time(7) = '01:02:03'; select @time 'time(7)', datediff( minute, 0, @time ) 'minutes'; declare @minutes int = 90; select @minutes 'minutes', cast( dateadd( minute, @minutes, 0 ) time(7) ) 'time(7)';
Comments
Post a Comment