By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

Pivot and concatenate

Uncle Dickie
P: 67
Sorry, another pivot type problem from me! In this instance I have a table showing parts and shortages:

PartNo, Component Shortage
PART1, ResA
PART1, ResB
PART2, CapA
PART2, CapB
PART2, ResA

What I want to end up with is a single 'shortages' column against a part:

PartNo, Shortages
PART1, ResA + ResB
PART2, CapA + CapB + ResA

Is this possible and if so any pointers?
Many thanks,

Richard
Nov 6 '08 #1
Share this Question
Share on Google+
3 Replies


ck9663
Expert 2.5K+
P: 2,878
You can use the technique I discussed in my blog. Read more about it here

Happy Coding!


-- CK
Nov 6 '08 #2

Uncle Dickie
P: 67
Thanks CK,
I can see how that works if I want all entries in the second column as one string, but I need it to group it by the first column. I can't see a way of changing your code to do this.
Nov 6 '08 #3

Uncle Dickie
P: 67
I may have found a solution here

It looks to be working so far but I have more playing to do! This is the first time I have ventured into functions!
Nov 6 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.