sql server 计算两个时间 相差的 几天几时几分几秒
程序员文章站
2022-04-30 19:53:50
CAST ( CAST ( DATEDIFF ( ss, StartTime, ConcludeTime ) / ( 60 * 60 * 24 ) AS INT ) AS VARCHAR ) + '天' + CAST ( CAST ( DATEDIFF ( ss, StartTime, Conclu... ......
cast ( cast ( datediff ( ss, starttime, concludetime ) / ( 60 * 60 * 24 ) as int ) as varchar ) + '天' + cast ( cast ( datediff ( ss, starttime, concludetime ) % 86400 / 3600 as int ) as varchar ) + '小时' + cast ( cast ( datediff ( ss, starttime, concludetime ) % 3600 / 60 as int ) as varchar ) + '分' + cast ( cast ( datediff ( ss, starttime, concludetime ) % 60 as int ) as varchar ) + '秒' lengthoftime
上一篇: MySQL数据库安装
下一篇: ElasticSearch 索引 剖析