• Apologies for the confusion, Kevin - thanks for having a look! In a hurry this morning, so I sketched it out pretty fast.

    I'll set up some supporting scripts for setup as soon as I have a minute, but the output I currently get looks like:

    OrderID | MaxConsecutiveDays

    14, 5

    Meaning that my required output returns, for each order, the maximum number of consecutive days which are uninterrupted by exclusion dates. In the quick sketch, I believe that would be five days for order 14, as the exclusion periods are weekends, other than one random Wednesday.