标签:finish sha arch varchar nis select pmi src get
这是自己写的方法,总觉得会有更好的办法实现这个效果呢?
SELECT case when CONVERT(nvarchar,DATEDIFF(SECOND,FinishAt,getdate() ))>86400 then CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )/86400)+‘天‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%86400/3600)+‘时‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%86400%3600/60)+‘分‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%86400%3600%60)+‘秒‘ when CONVERT(nvarchar,DATEDIFF(SECOND,FinishAt,getdate() ))>3600 then CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )/3600)+‘时‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%3600/60)+‘分‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%3600%60)+‘秒‘ when CONVERT(nvarchar,DATEDIFF(SECOND,FinishAt,getdate() ))>60 then CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )/60)+‘分‘+CONVERT(nvarchar, DATEDIFF(SECOND,FinishAt,getdate() )%60)+‘秒‘ else CONVERT(nvarchar,DATEDIFF(SECOND,FinishAt,getdate() ))+‘秒‘ end TimeSpend FROM [BPMDB].[dbo].[BPMInstTasks] A
标签:finish sha arch varchar nis select pmi src get
原文地址:https://www.cnblogs.com/tianxiaotian/p/10277141.html