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 |
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-12-05 : 01:41:23
|
| I am not sure what it is correctly called but i have the below querythat i need to display in a grid with the UserID down the side and the Month accross the top...like thisUSERID | JAN | FEB | MAR | APR | ETC2345765425673456HERE IS THE QUERY... I NEED ALL THE DATA TO BE IN SEPERATE MONTH COLUMNS IS THERE A WAY TO DO IT?SELECT dbo.WTournament_Results.TRID, dbo.WTournament_Results.TID, dbo.WUsers.UserFirstName, dbo.WUsers.UserLastName, dbo.WTournament_Results.TRPartner, dbo.WTournament_Results.TRTotalWt, dbo.WTournament_Results.TRBigFishWt, dbo.WTournament_Results.TRFishDead, dbo.WTournament_Results.TRFishCaught, dbo.WTournament_Results.TRPlace, dbo.WTournament_Results.TRPartnerWt, dbo.WTournament_Results.TRDebriefPoints,dbo.WTournament_Results.TRMtgPoints,dbo.WTournament_Points.Points AS TRPointsFROM dbo.WTournament_Results INNER JOIN dbo.WTournaments ON dbo.WTournament_Results.TID = dbo.WTournaments.tournID INNER JOIN dbo.WTournament_Points ON dbo.WTournament_Results.TRPlace = dbo.WTournament_Points.Place LEFT OUTER JOIN dbo.WUsers ON dbo.WTournament_Results.TRUserID = dbo.WUsers.UserID |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2007-12-05 : 11:30:55
|
| Use PIVOT functionality to get the data onto column format. Refer to BOL for example usage. |
 |
|
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-12-05 : 13:44:59
|
thanks!quote: Originally posted by visakh16 Use PIVOT functionality to get the data onto column format. Refer to BOL for example usage.
|
 |
|
|
|
|
|
|
|