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 |
|
rebooot
Starting Member
9 Posts |
Posted - 2009-11-30 : 21:10:17
|
| Hello all,I am attempting to convert this VBA code in my MS-Access database to SQL server 2005. I can't do it for some reason. I would appreciate your help greatly:PARAMETERS SQLPeriodIndex Text ( 255 ), theMarket Text ( 255 ), theSegment Text ( 255 );TRANSFORM Sum(Choose([SQLPeriodIndex],[L4],[L12],[L24],[L52],[YTD],[YTG])) AS SumOfSELECT Data_3.TagFROM Data_3 INNER JOIN SKU_CONTENTS ON Data_3.Tag=SKU_CONTENTS.TAGWHERE (((Data_3.Market)=[theMarket]) AND ((SKU_CONTENTS.SEGMENT)=[theSegment]))GROUP BY Data_3.TagPIVOT Data_3.Fact;I can even make SQLPeriodIndex another variable to passed to the code, but I need the PIVOT equivalent in SQL Server.Thank you so much.I hope someone is up tonight working.Regards to all, |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|