A T-SQL function to calculate recurring dates See the blog post: https://sqlsunday.com/2013/07/07/recurring-dates/