• Thanks all for the suggestions. I figured it out. One of the joined tables had been changed and field that was previously an integer was now a varchar. It was in the where clauses.

    I knew it was in the 1st part of the CTE and I simply broke it down eliminating grouping and where clauses till I got it running then adding things back in one at a time.