• I don't understand completely your problem. Please read the article linked on my signature to guide you on your posts and get better help. If you give me DDL, some sample data and expected results based on the sample data, I can give you more help.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2