fartzy Commented 1 Years ago through
Puzzles
I used a CTE to get the minimum date of each group, then a recursive cte to build on that. There are some problems with my solution, it assumes that the first row after each minimum date meets some criteria.