SDU Tools: Dates Between No Weekends
The DatesBetweenNoWeekends function in our free SDU Tools for developers and DBAs, is really popular. It provides a range of dates between starting and ending dates, ignoring weekends.
DatesBetweenNoWeekends is a simple table-valued function that takes two parameters:
@StartDate - the first date to return @EndDate - the last date to return
The columns returned are:
DateNumber - a sequential number for the dates returned DateValue - the date
Find out more
You can see it in action in the main image above, and in the video here. The full current version of the code is also shown below:
2020-05-20