0
Follows the code:
DModuleGrid.qtudo.close;
DModuleGrid.qtudo.sql.clear;
DModuleGrid.qtudo.sql.add('select numcupom from tabc460 where cderr <:mc');
DModuleGrid.qtudo.parambyname('mc').asinteger := 0;
DModuleGrid.qtudo.open;
if DModuleGrid.qtudo.recordcount > 0 then
begin
DModuleGrid.qres2.close;
DModuleGrid.qres2.sql.clear;
DModuleGrid.qres2.sql.add('delete from tdcupant where impcaixa = '+
QuotedStr(impcaixa)+' and dtcompra between :dini and :dfim');
DModuleGrid.qres2.parambyname('dini').asdate := date1;
DModuleGrid.qres2.parambyname('dfim').asdate := date2;
DModuleGrid.qres2.execsql;
DModuleGrid.qtudo.close;
DModuleGrid.qtudo.sql.clear;
DModuleGrid.qtudo.sql.add('insert into tdcupant (select * from tabc460 '+
'where dtcompra between :dini and :dfim) ');
DModuleGrid.qtudo.parambyname('dini').asdate := date1;
DModuleGrid.qtudo.parambyname('dfim').asdate := date2;
DModuleGrid.qtudo.execsql;
end;
So my question is whether delete
, will only delete those he found in Recordcount
, or delete everything he finds...
Could someone enlighten me?
It worked, buddy, now I get it right. Thank you.
– Ramon Ruan