I voted for choice A because B doesn't account for leap years, and C is wrong.
There are two problems in the case statement. It requires both the day and month to be greater, then it subtracts a year for those who have already had their birthday.
The 1 and 0 should be reversed.
Further, if the month is before today's month, but the day is after it (or vice versa), the AND result will be FALSE, causing the wrong action to be taken.
If today's date is 3/5/2008 and the date of birth is 2/11/1980, the function will return 27 rather than the correct answer of 28 since 2 < 3 but 11> 5.
The statement should be:
[font="Courier New"]DATEDIFF(yy, DateOfBirth, GETDATE()) - CASE WHEN DATEPART(m, DateOfBirth) >= DATEPART(m, GETDATE()) OR DATEPART(m, DateOfBirth) = DATEPART(m, GETDATE()) AND DATEPART(d, DateOfBirth) >= DATEPART(d, GETDATE()) THEN 1 ELSE 0 END[/font]
This is yet another example of why date calculation is so tricky. I'm excited about the DATE and TIME datatypes in 2008, whenever it actually ships.
But boss, why must the urgent always take precedence over the important?