I need to crosstab/transpose/pivot some data in a table that has 2 columns. The table looks like this...
I need for it to look like this...
Theoretically, there could be a large number of Songs for a particular ID, so the preference would be to create the number of Song columns dynamically.
I *thought* I had done something like this using a Crosstab Query, but I'm not seeing how to do it now. I've scoured the Internet for a simple way to do this (which seems like a simple problem that isn't that unique), but have not found anything simple. I've found several results using VBA to do something sort of along the same lines of what I need, but nothing doing exactly what I need. Based on the VBA examples I've found, I've been attempting to kluge together my own VBA to create a new table and loop through the IDs and fill columns with the Songs data, but I'm not all that good with VBA so it's about to get out of hand for me.
Does anyone know of a simple way to do this??
Thanks for your help!
HTML:
<pre>
ID Song
--- ------
927361283 If I Only Knew What I Was Doing
927361283 This Stuff Is Making Me Crazy
718263510 Hep Me, Hep Me
615243019 A Simple Solution Would Make My Day
</pre>
I need for it to look like this...
HTML:
<pre>
ID Song1 Song2
--- ------ -------
927361283 If I Only Knew What I Was Doing This Stuff Is Making Me Crazy
718263510 Hep Me, Plz!
615243019 A Simple Solution Would Make My Day
</pre>
Theoretically, there could be a large number of Songs for a particular ID, so the preference would be to create the number of Song columns dynamically.
I *thought* I had done something like this using a Crosstab Query, but I'm not seeing how to do it now. I've scoured the Internet for a simple way to do this (which seems like a simple problem that isn't that unique), but have not found anything simple. I've found several results using VBA to do something sort of along the same lines of what I need, but nothing doing exactly what I need. Based on the VBA examples I've found, I've been attempting to kluge together my own VBA to create a new table and loop through the IDs and fill columns with the Songs data, but I'm not all that good with VBA so it's about to get out of hand for me.
Does anyone know of a simple way to do this??
Thanks for your help!