Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sum two rows into a column (sticky situation)

Author  Topic 

gemini_shooter
Starting Member

12 Posts

Posted - 2008-11-18 : 21:34:41
Hello Guys,

I need some help...

Here is an image:



I have a ledger entry table and I am stuck at this ... I am pulling a dataset in SRS but this is the catch:

The table has 3 types of entires:

1=Payment
2=Invoice
3=Credit Memo

All these have a common field called "Cust_ ledger Entry No_".

I want to total the "Amount" for a single value of "Cust_ ledger Entry No_". and put it into a row with everything is same
except the [Document Type]='2' and a new column is created with this sum of the "Amount"

Can anyone please help.
   

- Advertisement -