MS SQL Server : calculate age with accuracy of hours and minuets
I need an SQL function to calculate age. It has to be accurate and cover all corner cases. It is for hospital ward for babies, so age of 30 minuets is a common case. I have a looked on other answers but could not find one that deals with all cases. For example: Baby born in 2014-04-29 12:59:00.000. And now is 2014-04-29 13:10:23.000, Age should be 0 Years, 0 Months, 0 Days, 0 Hours, 11 minutes It would be great if someone can provide the ultimate and definitive version of that function. (I am afraid that simple solutions with DateDiff are not good enough . As stated in a more popular question