Created
August 3, 2010 01:03
-
-
Save huacnlee/505627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MS SQL 对比两个时间相差 | |
-- 结果:10天3小时12分 | |
select | |
replace(str(datediff(d,getdate(),[due])) + '天' + | |
str(datediff(hh,getdate(),[due]) % 24) + '小时' + | |
str(datediff(mi,getdate(),[due]) % 60) + '分钟',' ','') as [remain] | |
from [users] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment