• Thanks again.

    Next question πŸ™‚ Can you post your table definitions please? There are some column names in the code that don't match what you originally posted. And, looking at your code there's a backslash in there that doesn't appear in your expected outcome. I'm starting to see what you're trying to achieve but I don't want to make any assumptions and get it wrong.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537