Ver Mensaje Individual
  #5  
Antiguo 12-07-2013
Lenny Lenny is offline
Miembro
 
Registrado: jun 2007
Posts: 161
Reputación: 17
Lenny Va por buen camino
Talking

Gracias estimados, dando vueltas con sus comentarios y códigos aplicándolo a lo que tenia resulto perfecto y quedo así:

Código Delphi [-]
procedure TClientes.Edit2Change(Sender: TObject);
const
 // suponiendo que esta sea tu consulta
 STRSQL = 'Select * from CONTACTOCLIENTE ';
 STRORDER = ' ORDER BY NOMBRES';
begin
   BDatos.QContactoCliente.Close;
   // Está vacío
   if (Edit2.Text = '') then begin
     BDatos.QContactoCliente.SQL.Text := STRSQL;
   end
   else begin
     // montamos la sql
     BDatos.QContactoCliente.SQL.Text := STRSQL +
        // Añadimos el WHER
        ' WHERE Upper(NOMBRES) LIKE Upper(' + QuotedStr('%' + Edit2.Text + '%') + ')' +
            'or Upper(APELLIDO) LIKE Upper(' + QuotedStr('%' + Edit2.Text + '%') + ')' +
        // Añadimos el orden
        STRORDER;
   end;
   BDatos.QContactoCliente.Open;
end;

Muchas gracias!!!
Responder Con Cita