Cita:
Empezado por jafera
Ahora ya no da error, pero no puedo hacer la busqueda incremental con el like?
|
Si Josep, sólo tenes que reemplazar el "=" por el operador
LIKE:
Código Delphi
[-]
var
C: string;
begin
if ComboBox1.Text = 'RAO_COMERCIAL' then
C:= 'B.'+ ComboBox1.Text
else
C:= 'A.'+ ComboBox1.Text;
with OrdenarGrid do
begin
Close;
SQL.Clear;
SQL.Add('SELECT A.IDCOMPRA, A.DATA_COMPRA, A.IDPROVEIDOR, B.RAO_COMERCIAL');
SQL.Add('FROM TR0004C A INNER JOIN TR0002 B ON B.IDPROVEIDOR = A.IDPROVEIDOR');
SQL.Add(Format('AND UPPER(%s) LIKE UPPER(:PARAM)', [C]));
SQL.Add(Format('ORDER BY %s', [C]));
ParamByName('PARAM').AsString:= '%' + Edit1.Text + '%';
Open;
end;
end;
Saludos