Query question

  • Thread starter Thread starter aspdb1028
  • Start date Start date
A

aspdb1028

To all,

I have a table like ->

Date Sym Qty Action Amount
1/1/09 GM 20 buy 40
1/1/09 GM 30 buy 60
1/1/09 GM 50 buy 100
1/2/09 GM 40 sell 120
1/2/09 GM 60 sell 180

Is there a way to query with result -

1/1/09 GM 100 buy 200
1/2/09 GM 100 sell 300

Thanks,

Frank
 
Hi,

Try something like :

SELECT Date, Sym, Action, Sum (QTY) as SumOfQty, Sum (Amount) as SumOfAmount
FROM tblMyTableName
GROUP by Date, Sym, Action

Regards

Kevin
 
Back
Top