Hi autoexcrement!
I would change this
WHERE
DATEDIFF(day, CTE1.terminationdate, CTE2.enrollmentdate) >= 45
to this
WHERE
DATEDIFF(day, CTE1.terminationdate, CTE2.enrollmentdate) < 45
to get the members with gap less than 45 days for 201, do you agree?
I have to try to get my head around this.....sorry for being a bother!! 🙁
Tammy