This function was written to supplant cumbersome age-at calculations. To execute, simply set a local INT variable equal to the output of the function. For example, the following, given my birthdate, computes my own age:
DECLARE @age_at INT
SET @age_at = dbo.f_age_at ('2/16/1954', GETDATE ())
2007-10-02 (first published: 2002-06-20)
15,449 reads