0

This question already has an answer here:

so this:

enter image description here

so I need: enter image description here any suggestions?

marked as duplicate by Paul White sql-server May 28 '16 at 13:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The point where I think this question is different is that there are multiple columns to pivot on. But the pattern in my answer should be able to be applied. – Rob Farley May 29 '16 at 5:53
1

Use a Matrix control in SSRS.

But in T-SQL:

You want a row per ID so you'll need GROUP BY ID

In the first column you want a time value where the activity is A, so use: MAX(CASE WHEN Activity = 'Activity A' THEN time END)

And then apply the pattern for all the others.

Not the answer you're looking for? Browse other questions tagged or ask your own question.