DataSet problems - selecting on aggregate functions

  • Thread starter Thread starter R Avery
  • Start date Start date
R

R Avery

I have a dataset containing an already-populated single datatable which
I which to perform an operation on. The structure of the table is
below: Specifically, I want to get the most recent message for every
unique {Group, User, Subject} subject to TimeStamp being less than an
AsOfDate that is externally specified. I then want to bind this table
to a DataGrid. I am having trouble since I am used to Access queries
(new to the .NET arena), and do not know where to start.


TableName: Messages

Fields:
Group (String)
User (String)
Subject (String)
Message (String)
TimeStamp (DateTime)

Primary Key: {Group, User, Subject, TimeStamp}


Any help would be most appreciated. Thanks!
 
DataTable.Compute(SUM(GROUP), "Group <> ''")
Use the compute function, yuo can specify a condition in the group so if you
want all the stuff for group summmed by user, loop through users and get
each unique value. Then call the Compute Function and bulid the filter so
User = LoopValue

You can nest your loops and filters and you'll be good to go.

Let me know if you have any problems.

Bill
 
Back
Top