• Calculations are done using a calendar year.

    For example if person A was born October 16, 1995, and we want to figure out how old he/she was on January 15, 2014, we can easily use DATEDIFF(day, '10/16/95', '1/15/14) to get 6,666 days, but we want the result to be formatted as 18 years, 2 months, 30 days. The years are easy, and the months aren't too bad, but the days calculation is based on December having 31 days, so there are 30 days between December 16, 2013 (18 years and 2 months after 10/16/95) and January 15, 2014. However, if we were calculating from 10/16/95 to March 15, 2014, our answer should be 18 years, 4 months, 27 days since there are only 28 days in February. And yes, you are correct that leap years do prevent an issue and need to be addressed.

    The issue with doing simple DATEDIFF in SQL is that it does a straight subtraction. From the example above:

    DATEDIFF(year, '10/16/95', '1/15/14') = 19 (but only 18 full years elapsed)

    DATEDIFF(month, '10/16/95', '1/15/14')%12 = 3 (but only 2 full months elapsed)

    Days is a real mess.

    How about this: DATEDIFF(YEAR, '12/31/13', '1/1/14') = 1! (not the factorial) when only 1 day has elapsed

    When comparing who is older when they achieved their Super Duper Fantastical Grandmaster Status, you have to use number of days because it is not affected by leap years, days in a month, etc.

    So if person A above was compared to person B who was born December 14, 1995 and achieved this noteworthy status on March 15, 2014, then both of them would be 6,666 days old:

    DATEDIFF(day, '10/16/95', '1/15/14') = DATEDIFF(day, '12/14/95', '3/15/14') = 6,666

    However, when formatted as YMD, person A is 18 years, 2 months, 30 days while person B is 18 years, 3 months, 1 day, which would make person A seem younger. My original response states why you can't just fix 30 days in a month or you could end up with x years, 12 months, and 4 days when 364 days elapsed from the previous year anniversary.

    I always use days when figuring out a "top 10" list, but I always format the answer as YMD so the age is meaningful to the audience.