• You did a nice job posting ddl and sample data. However, once you got to the output it went awry very quickly. You have things like "Answer-Staff" , "Response-Staff". What are those? What are the values supposed to be and why? In your sample data you have nothing but empty strings and a couple of actual values for response but in your expected outcome you have NULL, 0. Nowhere in your output are the two actual values from your sample data.

    You seem to be missing almost the entirety of the explanation of your desired output.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/