Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Best Way to Calculate Age

    The third query, the way it is written returns an incorrect age.

    This is the correct query:

    SELECT DATEDIFF(yy, DateOfBirth, GETDATE()) -

    CASE WHEN DATEPART(m, DateOfBirth) > DATEPART(m, GETDATE())

    AND DATEPART(d, DateOfBirth)...

Viewing post 1 (of 1 total)