|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Complex Aggregate Expression in DataColumnSay 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. 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. |
|||||||||||||||||||||||