• I'd like to have time to try the above non CTE approach, time doesn't allow at the moment but hopefully at some point.

    FYI the #test replica on my 'real' data yields about 600,000 rows so it's not an insignificant data set, however, it's probably quite a rare request (well, I've not had to dig into these tables for this info ever and we've had them on the go since 2008!)