468,316 Members | 1,992 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

Pivot and concatenate

Uncle Dickie
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
3 2750
ck9663
2,878 Expert 2GB
You can use the technique I discussed in my blog. Read more about it here

Happy Coding!


-- CK
Nov 6 '08 #2
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
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.

Similar topics

reply views Thread by Prasad Patil | last post: by
2 posts views Thread by Rob | last post: by
2 posts views Thread by Carl Gilbert | last post: by
3 posts views Thread by Jerry K via DotNetMonster.com | last post: by
9 posts views Thread by PeteCresswell | last post: by
1 post views Thread by Yitzak | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.