hi guys,
i'm having a problem with a TAggregateField on a filtered dataset. i'm using a simple SUM expression. before applying a filter, my aggregate field looks fine, it gives me the correct sum of all the records in the dataset. when i apply a filter to the dataset, the aggregate field returns the same value, not the filtered amount.
this is an example of how i'm creating my AggregateField.
fld = new TAggregateField(ClientDataSet);
fld->Active = true;
fld->Expression = "SUM(Amount)";
fld->ResultType = ftFloat;
fld->FieldName = "TotalAmount";
fld->DisplayFormat = "0.00";
fld->Alignment = taRightJustify;
fld->Index = DataSet->FieldCount;
fld->DataSet = DataSet;
any ideas why this would be happening??
please help!
K.