Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Best Way to Calculate Age

    The pseudocode is correct, the implementation isn't. The correct answer is:

    CAST(DATEDIFF(yy, @DateOfBirth, GETDATE()) - CASE WHEN RIGHT(CONVERT(CHAR(8), @DateOfBirth, 112), 4) <= RIGHT(CONVERT(CHAR(8), CURRENT_TIMESTAMP, 112), 4) THEN 0 ELSE 1...

Viewing post 1 (of 1 total)