@ColdCoffee, I see where the confusion is and my apologies for not specifying. This query has been simplified from a dynamically built PIVOT query. I actually...
I guess I don't understand how I can do that. If the PIVOT sub-query was written as shown below, the whole query fails because a VARCHAR cannot be part...