Viewing 2 posts - 1 through 2 (of 2 total)
Are you using join or not ???
March 6, 2008 at 11:01 am
#786217
I think Case condition has to be reversed and then we get the right answer
SELECT
DATEDIFF(yy, @DateOfBirth, GETDATE()) - CASE WHEN DATEPART(m, @DateOfBirth) >= DATEPART(m, GETDATE()) AND DATEPART(d, @DateOfBirth) >=...
March 6, 2008 at 10:55 am
#786210