• DesNorton (9/30/2016)


    1 - You have not provided a key that groups all of the data for a specific person. Although, from your pivot code, it appears that Period may be the key.

    2 - In order to PIVOT the data, you need to have unique values for Identifier. SQL has no way to know that you want to convert QuestionNo3 into QuestionNo3a, QuestionNo3b, QuestionNo3c.

    You can try to UPDATE TestTable1 and add 'a', 'b', 'c' to the end of each Identifier where there is more than one record for that identifier. Then your pivot code will work.

    Hi DesNorton,

    You are absolutely right, thanks so much for the idea and the solution

    I'm grateful.

    Tim