Board index » delphi » Calculated field in a grid
Laurie McIntosh
![]() Delphi Developer |
Calculated field in a grid2005-07-17 05:26:01 AM delphi60 Howdy people, I've got an grid component attached to a datasource component attached to an IBQuery component. The IBQuery.SQL looks something like this: SELECT MYNAME, SUM(MYSALES) AS TOTALSALES FROM MYTABLE GROUP BY MYNAME I want to add a calculated field column to the grid. The field would show what percentage of the total sum of MYSALES was sold by each MYNAME - something like TOTALMYSALES / SUM(TOTALSALES) * 100. Think I can work out how to do this mindnumbingly simple task? Nope. What I have been looking at is adding a new field to the IBQuery, but it looks like the calculation won't work because I am using a field value with an aggregate. Or possibly I am typing the expression in the wrong place. Can anyone offer me an answer here? D8, FB2 if that makes a difference... Regards, Laurie |