• Thank you very much for your help. I was under the impression that after using a CTE, you had to SELECT from it. I didn't realise you could create multiple CTEs and then combine them as you have.