• Jeff Moden (9/12/2014)


    The following should do it (see attached). I made sure that it's a high performance iTVF instead of an mTVF. I also got rid of the resource hungry, performance robbing recursive CTE that counts and added a column to return the number of days in each week. Of course, you can remove that column if you'd prefer it not to be there.

    Nice one Jeff, is there a spackle coming?

    😎