Ver Mensaje Individual
  #5  
Antiguo 27-06-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Reputación: 25
egostar Va camino a la fama
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.
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita