select *,datediff(day, (dateadd(month,0,getdate())),CertificateTime),Rmind=case
when ( CertificateTime between getdate() and dateAdd(dd,30,getdate())) then ('请注意,您的健康证即将到期')
when datediff(day, (dateadd(month,0,getdate())),CertificateTime)<=0 then ('请注意,您的健康证已过期')
else ''
end
from HealthCertificate
when ( CertificateTime between getdate() and dateAdd(dd,30,getdate())) then ('请注意,您的健康证即将到期')
when datediff(day, (dateadd(month,0,getdate())),CertificateTime)<=0 then ('请注意,您的健康证已过期')
else ''
end
from HealthCertificate