How do I determine a public holiday in Sql server?

前端 未结 24 1868
慢半拍i
慢半拍i 2020-12-05 14:40

I have an application written in c# that cannot run on a public holiday or a weekend. I\'ve looked around a bit and haven\'t found anywhere (official) that provides all the

24条回答
  •  隐瞒了意图╮
    2020-12-05 15:31

    I tried the "answer" and spent time to heavily modify it to be more readable. Really those "-DATEPART" options aren't needed since we are setting the date right before. It worked pretty well but was having issues with MLK day 2020 so my trust in it was shaky.

    Additionally I didnt like the fact that it was very difficult to read. I found this and it's much easier to get through. It works very similar to a date dimension table and tested accurately for the 3 years I tried.

    https://www.codeproject.com/Tips/1168430/US-Federal-Holidays-SQL

提交回复
热议问题