Home All Groups Group Topic Archive Search About

DataColumn.Expression Filter on Child

Author
5 Feb 2007 5:31 PM
flacmonster
I have a field in a parent row that needs to be set to the sum of a
field in its children.  That part is easy enough, as follows:

Sum(Child.ColumnName)

However, I need to filter out some of the children rows for the sum.
So what I want is something like this:

Sum(Child.ColumnName) WHERE Child.OtherColumnName = 'Some String'

I get an error which essentially states that there should be an
operand to the right of "Where"

Any ideas?

Kelly Smith

Author
5 Feb 2007 9:47 PM
Miha Markic [MVP C#]
I don't think you'll be able to do it that way.
Instead I would do calculations myself.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

<flacmons***@gmail.com> wrote in message
Show quote
news:1170696685.558613.192720@k78g2000cwa.googlegroups.com...
>I have a field in a parent row that needs to be set to the sum of a
> field in its children.  That part is easy enough, as follows:
>
> Sum(Child.ColumnName)
>
> However, I need to filter out some of the children rows for the sum.
> So what I want is something like this:
>
> Sum(Child.ColumnName) WHERE Child.OtherColumnName = 'Some String'
>
> I get an error which essentially states that there should be an
> operand to the right of "Where"
>
> Any ideas?
>
> Kelly Smith
>

AddThis Social Bookmark Button