sql server生日提醒语句实现方法
--当天过生日的
select * from dbo.CUSTOM_BASE where month(DATEOFBIRTH) = month(getdate()) and day(DATEOFBIRTH) = day(getdate())
--三天以内过生日的
select * from CUSTOM_BASE where month(DATEOFBIRTH) = month(dateadd(dd,3,getdate())) and (day(DATEOFBIRTH) = day(dateadd(dd,3,getdate())) or day(DATEOFBIRTH) = day(dateadd(dd,2,getdate())) or day(DATEOFBIRTH)=day(dateadd(dd,1,getdate())))
慎于行,敏于思!