• I don't have your tables, so those queries are not useful to me to create the data. Like I said, you need to provide create table statements and inserts for the data you need to have in them to produce your expected outputs.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service