DECLARE
@birthdt DATETIME,
@targetdt DATETIME
SELECT
@birthdt = '1/15/1930',
@targetdt = '12/31/2000'
SELECT
age = CONVERT(INT, DATEDIFF(yy, @birthdt, @targetdt)) -
(CASE WHEN (MONTH(@birthdt) = MONTH(@targetdt)) AND
(DAY(@birthdt) > DAY(@targetdt))
THEN 1
ELSE 0
END)
I'm still wondering, though, whether there's an easier way to do this?