Forum Replies Created

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

  • RE: CASE Statement

    Yes, Kenneth's works but Ken McKelvey's (the one I quoted) doesnt

  • RE: CASE Statement

    Doesnt work when date1 is not null and date2 is null

    Ken McKelvey (7/22/2009)


    CASE

    WHEN COALESCE(date2, 0) < COALESCE(date1, 0)

    THEN date2

    ELSE COALESCE(date1, date2)

    END

    CASE

    WHEN @d1 < COALESCE(@d2,'20991231') THEN @d1

    ELSE @d2

    END

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