Ver Mensaje Individual
  #8  
Antiguo 14-09-2010
ARPE ARPE is offline
Miembro
 
Registrado: oct 2003
Posts: 11
Reputación: 0
ARPE Va por buen camino
Hola, me temo que es cuestión de comillas y cuentan por ahí que es más eficiente "starting with" que "like xxx%".

La consulta quedaría algo así:

IBuscar.SQL.Add('SELECT IDENTIFICADOR, NOMBRE1, NOMBRE2, APELLIDO1, APELLIDO2, NOMCOMERCIAL FROM NOMBRE WHERE NOMBRE1 LIKE ''' + edit1.text + '%'' ORDER BY NOMBRE2');

Todo son comillas simples, pero cuentan que es mejor esta

IBuscar.SQL.Add('SELECT IDENTIFICADOR, NOMBRE1, NOMBRE2, APELLIDO1, APELLIDO2, NOMCOMERCIAL FROM NOMBRE WHERE NOMBRE1 starting with ''' + edit1.text + ''' ORDER BY NOMBRE2');

y lo malo como el usuario te escriba L'Andreu

saludos.
Responder Con Cita