日期:2014-05-17 浏览次数:20772 次
select 客户名称 ,
case when datediff(dd,sj1,getdate)>90 or
datediff(dd,sj2,getdate)>90 or
datediff(dd,sj3,getdate)>90 or
datediff(dd,sj4,getdate)>90
then '该企业执照到期'
else '未过期' end as state,
case when datediff(dd,sj1,getdate)>90
then '营业执照有效期没过期。'
when datediff(dd,sj1,getdate) <0
then '营业执照有效期过期。'
else '营业执照有效期即将过期。'
end +
case when datediff(dd,sj1,getdate)>90
then '税务登记证有效期没过期。'
when datediff(dd,sj1,getdate) <0
then '税务登记证有效期过期。'
else '税务登记证有效期即将过期。'
end +
case when datediff(dd,sj1,getdate)>90
then '卫生许可有效期没过期。'
when datediff(dd,sj1,getdate) <0
then '卫生许可有效期过期。'
else '卫生许可有效期即将过期。'
&n