Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Complex datarelation?

Author  Topic 

benji012e
Starting Member

12 Posts

Posted - 2007-11-09 : 18:26:44
Hi,

I have two datatables in a dataset, and I'd like to have the parent table have an expression based column that gives a sum of values in child rows. Simple enough, but the child values I want included are determined by a range of dates. The parent table has 2 columns: start date and end date. Is there a way to base a datarelation around this, so that I could use an expression like Sum(Child.Cost) and have it choose the valeus based on a range of dates created from 2 fields in the parent table? I figure that a regular datarelation obtains child rows where ChildTable.Field1 = ParentTable.Field1, so it would be more like where ChildTable.Field1 > ParentTable.MinDate And ChildTable.Field1 < ParentTable.MaxDate

Thanks for any help...

-Ben
   

- Advertisement -