When I try to access the value of an aggregate field (SUM_TOTAL) as the following line:
DM.cdsTOTAL.AsCurrency := DM.cdsItemSUM_TOTAL.AsCurrency;
The following error occurs:
Cannot access field ‘SUM_TOTAL’ as type float.
My temporary solution is this:
DM.cdsTOTAL.AsCurrency := StrToCurrDef(DM.cdsItemSUM_TOTAL.AsString, 0);
Any other suggestions?
You can implement Class Helpers for TAggregateField and if needed for TAggregate