April 8, 2011 at 6:27 am
Hi,
Please help - I have tried to find a solution but with no success - I have the below data:
Employee NoNameJob TitleTraining CodeTraining Code DescResultYear EnrolledTraining Start DateTraining End DateRank
01763369LEKHANYA LHTEAM LEADER DEVELOPMENTWELLWPWELLNESS IN THE WORKPLACEPASS20102010/04/292010/04/291
01763369LEKHANYA LHTEAM LEADER DEVELOPMENTTR7208DEVELOPMENT TEAM LEADERPASS20102010/12/022010/12/022
Which I must change so that the colums show in one row:
Employee NoNameJob TitleTraining CodeTraining Code DescResultYear EnrolledTraining Start DateTraining End DateRankTraining CodeTraining Code DescResultYear EnrolledTraining Start DateTraining End DateRank
01763369LEKHANYA LHTEAM LEADER DEVELOPMENTWELLWPWELLNESS IN THE WORKPLACEPASS20102010/04/292010/04/291TR7208DEVELOPMENT TEAM LEADERPASS20102010/12/022010/12/022
Your help would rally be much appreciated - thank you
April 8, 2011 at 6:57 am
How many rows per employee?
Far away is close at hand in the images of elsewhere.
Anon.
April 8, 2011 at 7:00 am
it will differ from employee but max will be 10 - Thank you
April 8, 2011 at 7:06 am
vilonel (4/8/2011)
it will differ from employee but max will be 10 - Thank you
Please check out the two links in my signature dealing with Cross-Tabs and Pivot tables - parts 1 and 2. Part 2 covers doing it dynamically, which if the # of columns will vary, this sounds like what you will be needing.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 8, 2011 at 7:14 am
thanks WayneS - will read the links - but will a pivot \ crosstab work for my scenario because I am not looking to sum, count etc values - I just want to have my dubplicate records in one row with the varouis training records next to each other per record (employee).
April 8, 2011 at 7:19 am
You can still use the pivot summing on an irrelevant column, and ignore it.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgMay 15, 2011 at 6:29 pm
vilonel (4/8/2011)
thanks WayneS - will read the links - but will a pivot \ crosstab work for my scenario because I am not looking to sum, count etc values - I just want to have my dubplicate records in one row with the varouis training records next to each other per record (employee).
Just use MAX instead of SUM and it'll work just fine.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 15, 2011 at 9:01 pm
Jeff Moden (5/15/2011)
vilonel (4/8/2011)
thanks WayneS - will read the links - but will a pivot \ crosstab work for my scenario because I am not looking to sum, count etc values - I just want to have my dubplicate records in one row with the varouis training records next to each other per record (employee).Just use MAX instead of SUM and it'll work just fine.
or that... :hehe:
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgViewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply