I often need to know if a date that I'm working with is a week day or a weekend. While T-SQL has some functions that help with that, you need to use a combination of them to get a reliable outcome that's independent of the current session settings. (Based on Saturday / Sunday being weekends but easy for you to change if you have different weekends). To make it easy, we added two functions IsWeekday and IsWeekend to our free SDU Tools for developers and DBAs.
The functions are simple. They take a single parameter @InputDate and they return a bit value which is 1 if the function is returning true.
You can see them in action in the main image above, and in the video here:
To become an SDU Insider and to get our free tools and eBooks, please just visit here: