• You have something close to solvable. can you post DDL, Sample data, and the desired output for your tables stripped down to resemble the problem. That will help allot on this problem. If you are not sure what im asking about the first link in my signature has all the details.

    since you are asking a specific tuning question more information will be helpful.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]