Date Calculation

Database
Enthusiast

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.
1 REPLY
Teradata Employee

Re: Date Calculation

How about just
SELECT 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)