|
-
Jan 22nd, 2003, 08:21 AM
#1
Thread Starter
Lively Member
find max, min, sum of a column?
i have a datatable with a column of doubles.
how would i find the largest and smallest double in the column, and add the column? i dont want to loop through it... that's too easy
if you choose not to decide you still have made a choice!
RUSH rocks!
-
Jan 22nd, 2003, 08:35 AM
#2
Fanatic Member
Sort the column and then pick up the first and the last item.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Jan 22nd, 2003, 10:55 AM
#3
Thread Starter
Lively Member
will that affect the output when i apply it to a datagrid? i dont want it to be sorted in the output.
if you choose not to decide you still have made a choice!
RUSH rocks!
-
Jan 22nd, 2003, 11:00 AM
#4
Hyperactive Member
Shot in the dark...
Well, if you're getting the list of values from a database table, could you not execute a second query such as...
Code:
SELECT MAX(dbo.Table1.Value), MIN(dbo.Table1.Value), SUM(dbo.Table1.Value) FROM dbo.Table1
...to get the calculations you're after?
Another satisfied customer 
-
Jan 22nd, 2003, 11:15 AM
#5
Thread Starter
Lively Member
i'm not using a database table. i'm populating the datatable using other calculations.
btw - i dont know what a database table is and how to use it either
if you choose not to decide you still have made a choice!
RUSH rocks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|