Question: how to calculate age in years months and days in sql?
Answer: Declare@dateofbirthdatetime. Declare@currentdatetimedatetime. Declare@yearsvarchar(40) Declare@monthsvarchar(30) Declare@daysvarchar(30) set@dateofbirth='1986-03-15'--birthdate. set@currentdatetime =getdate()--current datetime. select@years=datediff(year,@dateofbirth,@currentdatetime)-- To find Years.