chrisssyp82
MIS
SQL Server 2008
Hi
I have an issue where i have two of the same accounts which i would like to merge together, the list looks like below:
AcctID AcctType AcctSubType Curr TransType Amount
1 CCY SET EUR Opening 1000
1 CCY SET EUR BUY -100
1 CCY SET EUR SEL 100
1 CCY SET EUR Closing 1000
2 CCY SET EUR Opening 2000
2 CCY SET EUR SEL 100
2 CCY SET EUR Closing 2100
So basically i would like to merge it so it looks like this:
AcctID AcctType AcctSubType Curr TransType Amount
1 CCY SET EUR Opening 3000
1 CCY SET EUR BUY -100
1 CCY SET EUR SEL 100
2 CCY SET EUR SEL 100
1 CCY SET EUR Closing 3100
However i can't think of the best way to code this in SQL in my stored proc. A point in the right direction would be much appreciated.
Thanks
Hi
I have an issue where i have two of the same accounts which i would like to merge together, the list looks like below:
AcctID AcctType AcctSubType Curr TransType Amount
1 CCY SET EUR Opening 1000
1 CCY SET EUR BUY -100
1 CCY SET EUR SEL 100
1 CCY SET EUR Closing 1000
2 CCY SET EUR Opening 2000
2 CCY SET EUR SEL 100
2 CCY SET EUR Closing 2100
So basically i would like to merge it so it looks like this:
AcctID AcctType AcctSubType Curr TransType Amount
1 CCY SET EUR Opening 3000
1 CCY SET EUR BUY -100
1 CCY SET EUR SEL 100
2 CCY SET EUR SEL 100
1 CCY SET EUR Closing 3100
However i can't think of the best way to code this in SQL in my stored proc. A point in the right direction would be much appreciated.
Thanks