I intuitively choose 2 because 1 and 3 are definitely wrong. 1 doesn't take care of month and day of birth at all and 3 does it in the wrong way. But the are all wrong. It can be easily verified with the script below. Play around with some values at the beginning and end of the month in both dates. I added a fourth solution which I think is correct.
declare @DateOfBirth datetime
declare @Today datetime
select @DateOfBirth = '2004/03/01'
select @Today = '2008/02/29'
select
DATEDIFF(yy, @DateOfBirth, @today)
select
FLOOR(CONVERT(decimal(9, 2), DATEDIFF(d, @DateOfBirth, @Today)) / 365.0)
select
DATEDIFF(yy, @DateOfBirth, @today)
- CASE
WHEN DATEPART(m, @DateOfBirth) >= DATEPART(m, @Today) AND DATEPART(d, @DateOfBirth) >= DATEPART(d, @Today) THEN
0
ELSE
1
END
select
DATEDIFF(yy, @DateOfBirth, @today)
- CASE
WHEN DATEPART(m, @Today) > DATEPART(m, @DateOfBirth)
OR (DATEPART(m, @Today) = DATEPART(m, @DateOfBirth)
AND DATEPART(d, @Today) >= DATEPART(d, @DateOfBirth)) THEN
0
ELSE
1
END