We will use Floor and DateDiff in-built Sql Server function as follows:-
SELECT (FLOOR(DATEDIFF(DAY,'2000-07-14', GETDATE()) / 365.25)) 'Current Age'
OutPut
14Explaination:- In above query,we have passed DOB as
2000-07-14 means 14 July 2000,and also notice that July has been passed now and august has come,that is the reason we are getting 14 Years.
SELECT (FLOOR(DATEDIFF(DAY,'2000-12-14', GETDATE()) / 365.25)) 'Current Age'
OutPut
13Explaination:- In above query,we have passed DOB as
2000-12-14 means 14 December 2000,and also notice that December has Not come Yet,that is the reason we are getting 13 Years.