select   *   from   表 
  where   
(datepart(month,getdate()) <> 12   and 
        datediff 
    ( 
        day 
        ,getdate() 
        ,dateadd(year,datediff(year,出生日期字段,getdate()),出生日期字段) 
    )   between   0   and   15) 
or   
(datepart(month,getdate())=12   and 
        datediff 
    ( 
        day 
        ,getdate() 
        ,dateadd(year,datediff(year,出生日期字段,getdate())+1,出生日期字段) 
    )   between   0   and   15) 
- 本文标题: 查询生日既将到来的用户 SQL语句
- 文章分类:【SQLServer】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.