sql server 计算两个时间 相差的 几天几时几分几秒
Posted 兰博丶专属
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql server 计算两个时间 相差的 几天几时几分几秒相关的知识,希望对你有一定的参考价值。
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
以上是关于sql server 计算两个时间 相差的 几天几时几分几秒的主要内容,如果未能解决你的问题,请参考以下文章