Is it possible to use calculated fields in aggregated fields?

Posted by Jørn E. Angeltveit on Stack Overflow See other posts from Stack Overflow or by Jørn E. Angeltveit
Published on 2010-05-12T23:27:33Z Indexed on 2010/05/12 23:34 UTC
Read the original article Hit count: 326

Filed under:
|

Is it possible to use a calculated field in an aggregated field in a TClientDataSet?

  object cdsOrders: TClientDataSet
    AggregatesActive = True

    object cdsOrdersPrice : TIntegerField
      FieldName = 'Price'
    end
    object cdsOrdersCount: : TIntegerField
      FieldName = 'Count'
    end

    object cdsOrdersCalcTotal: TIntegerField
      FieldKind = fkInternalCalc
      FieldName = 'CalcTotal'
      Calculated = True
    end

    object cdsOrdersAggGrandTotal: TAggregateField
      FieldName = 'AggGrandTotal'
      Active = True
      Expression = 'SUM(CalcTotal)'
    end

  end

© Stack Overflow or respective owner

Related posts about delphi

Related posts about tclientdataset