Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Best Way to Calculate Age

    There are many ways to give the right answer...

    Your solution is returning me a star character (*)... A dimension musl be provided to the @result variable declaration: Declare @result VarChar(10)......

  • RE: Best Way to Calculate Age

    Declare @d smalldatetime

    set @d = '1957/7/5'

    Select DATEDIFF(yy, @d, GETDATE()) -

    CASE WHEN

    DATEPART(m, @d) < DATEPART(m, GETDATE())

    OR (

    DATEPART(m, @d) = DATEPART(m, GETDATE())

    AND

    DATEPART(d, @d) <= DATEPART(d, GETDATE())

    ) THEN 0 ELSE...

Viewing 2 posts - 1 through 2 (of 2 total)