日期:2014-05-18 浏览次数:20578 次
select * from tb where datediff(mm,addtime,getdate())<=3 ---3个月内 select * from tb where datediff(mm,addtime,getdate())>3 --3个月外
------解决方案--------------------
select * from tb where datediff(mm,addtime,getdate())<=3 ---3个月内 or select * from tb where datediff(mm,addtime,getdate())>3 --3个月外
------解决方案--------------------
select * from tb where datediff(mm,addtime,getdate())<=3 ---3个月内
select * from tb where datediff(mm,addtime,getdate())>3 --3个月外
------解决方案--------------------
select * from tb where dateadd(mm,3,addtime)>=getdate() ---3个月内 select * from tb where dateadd(mm,3,addtime)<getdate() --3个月外