SDU Tools: DatesBetween - all dates between two dates in T-SQL
In our free SDU Tools for developers and DBAs, we have added many tools that help to manipulate dates.
When creating a date dimension (as part of dimensional modeling), you need to be able to get a list of all the dates between a start date and an end date. There are many other reasons why you might need to do this as well.
So we’ve added a table-valued function called DatesBetween to do just this. It takes a start date and an end date as parameters and returns all dates between. As well as the date values, it also numbers each of the dates.
2018-07-18