日期:2014-05-18 浏览次数:20756 次
case when datediff(day,[checkday],getdate())>(30) then '未检查' else '距离检查时间:' + rtrim(datediff(day,[checkday],getdate()) end)) +'天' end
------解决方案--------------------
case when datediff(day,[checkday],getdate())> 30 then '未检查' else '距离检查时间:' + convert(varchar(10), datediff(day,[checkday],getdate()) + '天' end
------解决方案--------------------
select case when datediff(dd,[checkday],getdate())>(30) then '未检查' else '距离检查时间:' + ltrim(datediff(dd,checkday,getdate())) +'天' end from tb