January 20, 2010 at 10:17 am
I'm trying to figure out following situation
I have table with data:
ID QuestionNr Answer
4376Q1Answer1_1
4376Q2Answer1_2
4376Q2Answer2_2
I would like to have result like this:
ID Q1 Q2 Q2
4376Answer1 Answer1_2 Answer2_2
I need to build this dynamically because i don't know how many columns i will get.
I've tried pivot, cursor, temporary tables. Problem is that multiple answer will generate columns with the same name
Thank You in advance for any example how to solve this problem.
Paul
January 21, 2010 at 6:52 am
Have you read the 2 Cross-Tab articles linked in my signature? The second one discusses how to do a dynamic Cross-Tab/Pivot which is what you need.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply