SDU Tools: Add Weekdays in SQL Server T-SQL

In the last SDU Tools post, I mentioned new functions to determine if a day is a weekday or a weekend. (Based on Saturday / Sunday being weekends but easy for you to change if you have different weekends).  Another issue that I often have is the need to add a number of weekdays to a given date. To make it easy as well, we added a function AddWeekdays to our free SDU Tools for developers and DBAs.

The function is simple.It takes two parameters:

@StartDate date – the date we want to add weekdays to
@NumberOfWeekdays – the number of weekdays to add

You can see it 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:

http://sdutools.sqldownunder.com

 

Leave a Reply

Your email address will not be published.