declare @dd datetime = '1947-2-24'select datediff(month, @dd, CURRENT_TIMESTAMP)/12
DECLARE @DOB DATETIMESET @DOB = '2008-12-31'DECLARE @Now DATETIMESET @Now = '2009-12-30'select datediff(month, @DOB, @Now)/12
select a.DOB, b.CurrDate, BirthdayCurrentYear = dateadd(yy,datediff(yy,a.DOB,b.CurrDate),a.DOB), Age = datediff(yy,a.DOB,b.CurrDate) + -- Subtract 1 if current date before birthday in current year case when b.CurrDate < dateadd(yy,datediff(yy,a.DOB,b.CurrDate),a.DOB) then -1 else 0 end from ( --Test Date of Birth select DOB = convert(date,'19600229') union all select DOB = convert(date,'19521013') ) a join ( -- Test Current Dates select CurrDate = convert(date,'20110227') union all select CurrDate = convert(date,'20110228') union all select CurrDate = convert(date,'20120228') union all select CurrDate = convert(date,'20120229') union all select CurrDate = convert(date,'20121012') union all select CurrDate = convert(date,'20121013') ) b on month(a.DOB) = month(b.CurrDate)order by a.DOB, b.CurrDate
DOB CurrDate BirthdayCurrentYear Age---------- ---------- ------------------- -----------1952-10-13 2012-10-12 2012-10-13 591952-10-13 2012-10-13 2012-10-13 601960-02-29 2011-02-27 2011-02-28 501960-02-29 2011-02-28 2011-02-28 511960-02-29 2012-02-28 2012-02-29 511960-02-29 2012-02-29 2012-02-29 52