• Hi your post has not been ignored, its just very complex for a 'newbie' question. I can't actually answer your question yet, though I have had a look.

    You have a complex splitter function using XML followed by some pivoting - hardly newbie material.

    Some advice: (to get better answers)

    1) Change to subject to metion the XML splitter function and Pivot - to attract people who know about those subjects

    2) Make it easier for people to test your query by providing CREATE TABLE statements and some INSERTS for sample data - it may be a pain doing it, but if I could cut/paste direct into management studio and run the code, I would be much nearer to working out an answer.

    3) If your data is sensitive - you may need to simplify the tables, and change the function accordingly.

    And welcome to the forum: Only joined myself a few weeks ago and its been an invaluable resource. 😀