试试这个:
declare @birthday datetime
declare @querydate datetime
set @birthday='1990-01-10'
set @querydate='2002-12-30'
declare @year int
set @year=year(@querydate)
if (convert(datetime, convert(varchar(4),@year)+'-'+convert(varchar(2), month(@birthday))+'-'+convert(varchar(2), day(@birthday)))-@querydate)<=15 or
(convert(datetime, convert(varchar(4),@year+1)+'-'+convert(varchar(2), month(@birthday))+'-'+convert(varchar(2), day(@birthday)))-@querydate)<=15
print 'yes'
else
print 'no'