like descriped here (and in the help) Aggregate Fields arent supported.
http://forums.devart.com/viewtopic.php? ... eld#p61550
So what is the best way, if you need the sum of a field of all records of a dataset?
is there sth around using "DisableControls, First, Next" etc? I do not want to use this way, because events like afterscroll are fired, etc.
currently my code looks like:
Code: Select all
R:=RecNo;
Result:=0;
DisableControls;
S:=AfterScroll;
AfterScroll:=Nil;
First;
try
while not EoF do begin
Result:=Result+FieldByName(SumFieldName).AsFloat;
Next;
End;
finally
RecNo:=R;
AfterScroll:=S;
EnableControls;
end;