Para asignar el valor al campo en la base de datos, es prácticamente lo mismo:
Código Delphi
[-]
with UnDataModule.UnQuery do begin
If active then close;
SQL.Clear;
SQL.Add('Update UnaTabla');
SQL.Add('Set Total = :vTotal');
SQL.Add('Where UnRegistro = :pUnRegistro');
Parameters.ParamByname('vTotal').AsCurrency := vTot_Brut.AsCurrency;
Parameters.ParamByName('pUnRegistro').AsString := IDRegistro.AsString;
ExecSQL;
end; .... with UnDataModule.UnQuery do begin
If active then close;
SQL.Clear;
SQL.Add('Insert into UnaTabla(IDRegistro, Total)');
SQL.Add('Values(:vUnRegistro, :vTotal');
Parameters.ParamByname('vTotal').AsCurrency := vTot_Brut.AsCurrency;
Parameters.ParamByName('vUnRegistro').AsString := IDRegistro.AsString;
ExecSQL;
end;