• Thanks for the quick reply. Having a little trouble getting the order correct with the code. Get the declare and set statements to work but the CTE is tripping me up.