Sum of column

ChristopherL

Registered User.
Local time
Today, 11:12
Joined
Jul 2, 2013
Messages
90
Hi!
I am having some trouble with a program that contains a query that is suppose to sum a bunch of market values that have the same ID and is from the same portfolio.

The problem I had at first was that some of these IDs and portfolios that should have been summed together had one called counterparty that had different values.

So the problem that occured was the following:

ID Portfolio CounterParty SumOfMarketValue
5224 SPAC Counterparty1 -55
5224 SPAC Counterparty2 -45

What I wanted

ID Portfolio SumOfMarketValue
5224 SPAC -100

So what I did was that I deleted that column, but I am guessing that the table somehow might save that they have this difference. Any suggestions on how I can make them appear in the same sum?

I find it quite hard to explain, but I hope you understand!

Thanks Christopher
 
ChristopherL, can you show the SQL query you currently have? It should be something like..
Code:
SELECT ID, Protfolio, Sum(MarketValue) As SumOfMarketValue
FROM theTableID
GROUP BY ID, Protfolio;
Make sure only these three fields are in the Query.. Anything other than the ID and Protfolio combination will result in what you have..
 
ChristopherL, can you show the SQL query you currently have? It should be something like..
Code:
SELECT ID, Protfolio, Sum(MarketValue) As SumOfMarketValue
FROM theTableID
GROUP BY ID, Protfolio;
Make sure only these three fields are in the Query.. Anything other than the ID and Protfolio combination will result in what you have..


Smoooth! :D thank you!
 

Users who are viewing this thread

Back
Top Bottom