• To get some decent answers, it might help if you post table DDLs, sample data and desired output.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP