All Forums Database
trying_to_learn 14 posts Joined 08/06
04 Aug 2006
Date Calculation

I am trying to calculate a date, given a birthdate how can you calculate age on any given day with the assumption that the person turns to 1 year older on the last day of February if they were born on a leap day (Ex:02/29/2000). Any help is appreciated.

Fred 1096 posts Joined 08/04
04 Aug 2006

How about justSELECT SomeDate - BirthDate YEAR(4) FROM ...Or if you want the result to be numeric rather than an "interval",CAST((SomeDate - BirthDate YEAR(4)) AS SMALLINT)

You must sign in to leave a comment.