日期:2014-05-17 浏览次数:20491 次
select * from x_user where and datediff(day,getdate(),(case when len(user_time)<5 then '3000-12-31' else user_time end)))>1
------解决方案--------------------
SELECT CASE WHEN LEN(user_time) < 5 THEN '3000-12-31' ELSE '' END
------解决方案--------------------
SELECT * FROM x_user WHERE DATEDIFF(day, GETDATE(), CASE WHEN LEN(user_time) < 5 THEN '3000-12-31' ELSE '' END) > 1
------解决方案--------------------
SELECT CASE WHEN LEN(user_time) < 5 THEN '3000-12-31' ELSE '' END,* FROM x_user WHERE datediff(day,getdate(),isnull(user_time,'3000-12-31'))>1
------解决方案--------------------
select (case when len(user_time)<5 then '3000-12-31' else user_time end) usertime from x_user where and datediff(day,getdate(),usertime))>1