Home All Groups Group Topic Archive Search About

Complex Aggregate Expression in DataColumn

Author
10 Dec 2004 4:31 PM
Paul2004
Say I wanted to do an aggregate sum (using the Northwind examples in MSDN
help) where relationships between 2 datatables exist, I would use:

SUM(Child.Price)

However, if I have a "IsDeleted" column in the child table, how would I
change the expression? I would need something like:

SUM(Child.Price WHERE Child.IsDeleted = 'FALSE')

Can anyone help me figure out what expression would work? Any tips would be
greatly appreciated.

Author
15 Dec 2004 11:49 AM
Paul2004
Would an IFF() function would work inside the sum? Something like:

SUM(IFF(Child.IsDeleted = 'FALSE', Child.Price, 0))

Can anyone help?

Show quote
"Paul2004" wrote:

> Say I wanted to do an aggregate sum (using the Northwind examples in MSDN
> help) where relationships between 2 datatables exist, I would use:
>
> SUM(Child.Price)
>
> However, if I have a "IsDeleted" column in the child table, how would I
> change the expression? I would need something like:
>
> SUM(Child.Price WHERE Child.IsDeleted = 'FALSE')
>
> Can anyone help me figure out what expression would work? Any tips would be
> greatly appreciated.

AddThis Social Bookmark Button