Advertisement

02.04.2004 at 09:29AM PST, ID: 20873319
[x]
Attachment Details

Need to Sum with Group By

Asked by warehouse1990 in .NET

Tags: group, dataview, datatable, sum

Hi, I'm actually using a DataView (because of Sorting) and am trying to sum with a group by. I have read about the DataTable compute method (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadataviewmemberstopic.asp). However, what i really need is a group by.  In Sybase, i would do the following:

select Side, Ticker, Sum(Quantity)
from MyTable
group by Side, Ticker

My dataset is individual rows, each containing side, ticker, quantity.

I have had cheesy ideas like looping through using the Dataview.FilterRow method and writing to a table.

Any thoughts?Start Free Trial
[+][-]02.04.2004 at 12:24PM PST, ID: 10274509

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: group, dataview, datatable, sum
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.18.2004 at 03:29AM PST, ID: 10622836

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03.22.2004 at 11:22AM PST, ID: 10651752

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32