Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: DATEADD and leap years

    Method-1 using

    SELECT CASE WHEN DAY(DATEADD(DD,-1,'01-MAR-'+'2015'))=29 THEN 'Leap Year' ELSE 'No Leap Year' END

    Result:

    No Leap Year

    SELECT CASE WHEN DAY(DATEADD(DD,-1,'01-MAR-'+'2016'))=29 THEN 'Leap Year' ELSE 'No Leap Year' END

    Result:

    Leap Year

    Method-2

    SELECT...

Viewing post 1 (of 1 total)