Expression Column - DataRelation - Filtering

  • Thread starter Jo?o P. Bragan?a
  • Start date
J

Jo?o P. Bragan?a

I would like to add an expression column that gets the count of child
rows that match a criteria:

Expression = "COUNT(Child(Inventory2Sales).Invoiced = false)";

However I get a SyntaxErrorException: "Syntax error in aggregate
argument: Expecting a single column argument with possible 'Child'
qualifier."

What is the proper syntax for this? Is it even possible?
 
L

Lloyd Dupont

something like

SELECT COUNT(*) As NotInvoice FROM MyTable WHERE Invoiced = false
 
W

William Ryan eMVP

That definitely won't work. you can use
DataTable.Compute(COUNT(CHILD(Inventory2Sales), "Invoiced = false") for a
one column issue. The filter condition is what's blowing up on this one.
 
J

Jo?o P. Bragan?a

So in other words it's impossible to have a data column with the
computed value already in it... is microsoft going to improve this
functionality in a later release of .net?
 
W

William Ryan eMVP

No, not at all.
Jo?o P. Bragan?a said:
So in other words it's impossible to have a data column with the
computed value already in it... is microsoft going to improve this
functionality in a later release of .net?

"William Ryan eMVP" <[email protected]> wrote in message
 
W

William Ryan eMVP

Sorry about that I didn't post the reply. I think the answer is to use the
straight expression syntax:
Expression = "COUNT(Child(Inventory2Sales.Invoiced)";

but build a dataview on the table and set the .RowFilter = "Invoiced =
false"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top