Haber si esto te puede servir
Código Delphi
[-]
function TForm1.No_Existe(Dato:String):Bool;
begin
Query1.Close;
Query1.SQL.Text := 'SELECT * FROM ESTADISTICAS WHERE VALOR = :dato';
Query1.ParamByName('Dato').AString := Dato;
Query1.Open;
If RecordsCount = 0 then
Result := True
else Result := False;
end;
........
........
While not QAux.EoF do begin
if No_Existe(QAux.FieldByName('conceptoDEBE').AsString) then begin
QEstadisticas.Insert;
try
QEstadisticas.FieldByName('categoria').AsString:='Gastos Generales';
QEstadisticas.FieldByName('valor').AsString:=QAux.FieldByName('conceptoDEBE').AsString;
QEstadisticas.FieldByName('cantidad').AsInteger:=QAux.FieldByName('cantidad').AsInteger;
QEstadisticas.FieldByName('subtotal').AsCurrency:=QAux.FieldByName('importe').AsCurrency;
QEstadisticas.Post;
except
QEstadisticas.Cancel;
end;
end;
QAux.Next;
end;
Aunque lo hice al aire porque no tengo mi Delphi, puede haber algun error.
Salud OS.
Edito: Se me adelanto
sara2005, y me parece una muy buena idea la del LOCATE.