Compute Holiday Day of the Month for any Year

  • eric.notheisen

    SSCommitted

    Points: 1633

    Comments posted to this topic are about the item Compute Holiday Day of the Month for any Year

  • Lee Linares

    SSCrazy

    Points: 2668

    Eric,
    Thanks for taking the time to share this code with us. Very handy. I am confused though with the New Years Day computations. You have these 2 lines:
    when 1 then DateAdd(d, 1,@sYear+'-'+'01'+'-'+'01')
    when 7 then DateAdd(d, 3,@sYear+'-'+'01'+'-'+'01')

    So if New Years Day falls on a Sunday (as in 2017) you add 1 day and it is celebrated on Monday. But if it falls on a Saturday (as in 2011) you add 3 days and it is celebrated on Tuesday. Wouldn't you just add 2 so it is celebrated on Monday?

    Thanks again.

     Lee

  • Lee Linares

    SSCrazy

    Points: 2668

    Eric,

    Sorry, but one other thing. In your example output for 2015 several of the Monday holidays are showing 5 for the DayOfWeek value and Presidents Day is showing 1.

    Lee

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

You must be logged in to reply to this topic. Login to reply