Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
EDBQuery Aggregate field |
Sat, Jan 17 2015 2:24 AM | Permanent Link |
Trinione | Hi:
I have a datagrid that has an EDBQuery as its datasource. How can I get a column total to display in a label field elsewhere on the form? I have created a TAggregate field named 'totalCost' using the Field Editor and have set the Expression property to 'SUM (items)', and set the Active and Visible properties to 'True'. However, when I access the field, it is blank. >> ShowMessage(EDBQueryCurrentDebts.FieldByName('totalItems').AsString); |
Sat, Jan 17 2015 3:32 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Trinione
I have never used a TAggregateField and googling I suspect it is only available for ClientDataSet Roy Lambert |
Mon, Jan 19 2015 6:20 PM | Permanent Link |
Adam Brett Orixa Systems | Trinione
I have not used the Aggregate field either, at least not for about 14 years, and I can't remember the full details, but I know that it cannot be used for the purpose you describe. Instead I think the easiest thing is to add a second query to your application and use a second query statement to generate the sum or sums required. You will need some code to synchronize the opening of the 2 queries, and perhaps passing in parameters to keep the values identical ... but that is not too hard to do. I can also suggest that there are a number of Grid components (Dev Ex dxGrid and others) which have built in code for generation of SUMs and other aggregates. You might find that is the easiest solution to the problem, although these components often cost a bit of money. |
Tue, Jan 20 2015 3:43 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
> although these components often cost a bit of money. Now that you're a lottery winner where do I send the begging letters to? Or did you just forget how to spell LOT? Roy |
This web page was last updated on Friday, September 20, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |