March 10, 2010 at 10:21 am
Try this
Select a.grp,sum(a.amount), b.ledgers From tbl a
join (
SELECT c.grp, ledgers = c.ledger + ',' + c.ledger
FROM tbl c ) b on a.grp = b.grp
Group by a.grp, b.ledgers
March 10, 2010 at 3:27 pm
I thought it might work but it didn't. Going back to the initial table we created, the result set is this.
grpledgers
1A01,A01
1A02,A02
1A03,A03
2A22,A22
3A33,A33
3A36,A36
Thank you for your time. All your tips were very helpfull and won't go to waste. I convinced my boss not to concanate.
Thank you so much.
March 10, 2010 at 8:02 pm
MelissaLevitt (3/10/2010)
I convinced my boss not to concanate.
Why? It's about the only option you have in 2000. Use the function I demo'd in the article for 2000.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 11, 2010 at 7:05 am
The function works perfectly but I can't use it because I have to work off of a temp table.
This data (the ledger info) will be used in a drill through report so the data can be displayed concatenated or not.
I did learn a lot from your article and it definately answered my question.
Thank you.
March 11, 2010 at 7:31 am
Dang... you're right... I forgot about the temp table.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply