Hi,
I want to calculate age in years, months. and days. Pls go through below formula and pls advice me , where i did mistake?
Select ename,floor(cast(DATEDIFF(d,hiredate, GETDATE())as varchar)/365.25) + ' Years ' +
floor(floor(cast(DATEDIFF(d,hiredate, GETDATE())as nvarchar)%365.25)/30.4375)+ ' Months ' +floor(floor(cast(DATEDIFF(d,hiredate, GETDATE())as nvarchar)%365.25)%30.4375)+ ' Days' as Age from empdetails
Thank you in advance
Regards
ajaypal