日期:2014-05-18 浏览次数:20558 次
update MarketingCaseExpire set ProjectEndState=case when DATEDIFF(month, getdate() , ProjectEndTime)=0 then '当月到期' when DATEDIFF(month, getdate() , ProjectEndTime)<0 then '已到期' when DATEDIFF(month, getdate() , ProjectEndTime)=1 then '下月到期' when DATEDIFF(month, getdate() , ProjectEndTime)>1 then '2个月后到期' end, CurrentMonthExpire=case when DATEDIFF(month, getdate() , ProjectEndTime)=0 then 1 else 0 end, Expired=case when DATEDIFF(month, getdate() , ProjectEndTime)<0 then 1 else 0 end, TwoMonthsAfterExpired=case when DATEDIFF(month, getdate() , ProjectEndTime)>1 then 1 else 0 end, OneMonthsAfterExpired=case when DATEDIFF(month, getdate() , ProjectEndTime)=1 then 1 else 0 end