Goodness, this one's gone on, hasn't it? And now I'm in it cuz of the row-size QOTD that had a naive age calculation thrown in.
Anyway, before reading through all 19 pages, I coded this:
Declare @DOB smallDatetime
Declare @Today smallDatetime
set @DoB = '02/29/2004'
set @Today = '2/29/08'
select @dob as Dob
,@today as Today
- casewhen month(@today) < month(@dob)
or (month(@today) = month(@dob) and day(@today) < day(@dob))
It turns out that it's pretty similar to some other solutions agreed to be correct, except that I used the functions "year()", "month()", and "day()" rather than "Datepart()".
Can someone who knows tell me why Datepart() would be preferrable? I like the distinct functions for readability.