Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
GreeneKL
Starting Member
3 Posts |
Posted - 2007-07-19 : 18:46:45
|
I have 3 tables: There is a many-to-many relationbetween T1 and T3, and the relation data is storedin T2.I have user who wants query results displayed as ifin Excel spreadsheet with data from T1 as row labels,data from T3 as column labels, and data from T2(relationship data) displayed as "X" in correspondingrow/column cell.Any ideas on how to accomplish this? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-19 : 19:07:36
|
search for CROSS TAB, PIVOT TABLE in this forum KH[spoiler]Time is always against us[/spoiler] |
 |
|
GreeneKL
Starting Member
3 Posts |
Posted - 2007-07-19 : 19:45:46
|
Table 1: WProcCols: WP# TitleTable 3: PersonCols: ID NameTable 2: Assigncols: wpID pIDOutput format (to be displayed via ASP.NET): name1 name2 name3 name4 ...WP1 XWP2 X X WP5 X XWP18 X XWP19WP20WP27...Where number of items in WProc and/or Personmay change at any time. |
 |
|
GreeneKL
Starting Member
3 Posts |
Posted - 2007-07-19 : 19:53:00
|
Let me try that display table again:WorkProc | Adam | Bill | Carla | David | Emily | ...WP1 | | x | | X | |WP2 | X | x | x | | |WP5 | | | | | X |WP6 | x | | x | | x | |
 |
|
|
|
|