Get the dates of the ‘x’ occurrence of the Weekday within the Month 0

You may want to find for example the date of the 4th Saturday in each month for a given year. This function came out of answering the question here: http://stackoverflow.com/questions/33694768/how-to-get-list-of-2nd-and-4th-saturday-dates-in-sql-server. I’ve created it as a Table Valued Function so you can bind it into any query you wish.   create function dbo.tvfn_dates_of_day_in_month_position ( @year_start date, […]