diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index 927b50158..bd8508ab8 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -3929,10 +3929,12 @@ begin case FValueType of fvtSum: begin - if F.OldValue <> null then - FTestValue := FTestValue - Float(F.OldValue); if not F.IsNull then + begin + if F.OldValue <> null then + FTestValue := FTestValue - Float(F.OldValue); FTestValue := FTestValue + F.AsFloat; + end; end; fvtMax: if not F.IsNull then FTestValue := Max(FTestValue, F.AsFloat);