34,594
社区成员
发帖
与我相关
我的任务
分享
declare @w numeric(12,2)
set @w = 110.2
declare @d int,@h int,@m int,@s int
select @d= @w/24
select @h= @w - @d * 24
select @m= (@w - @d * 24 - @h ) * 60
select @s= ( @w - @d * 24 - @h - @m*1.0 / 60) * 3600
select right('00'+ltrim(@d),2)+':'+right('00'+ltrim(@h),2)+':'+right('00'+ltrim(@m),2)+':'+right('00'+ltrim(@s),2)
/*
-------------------
04:14:12:00
(所影响的行数为 1 行)
*/