danz67
asked on
DELPHI 7 - Query
I get the records that contain different parameters, the problem is parameter: STATO I need to search for all records containing the parameter: STATO with value 'RIENTRATO and RIPARATO, I tried with this code, but I get no records displayed
with DataModule2.QAssistenze do
begin
SQL.Text :=
'select * from riparazioni where cliente = :cliente '+
'and StatoAssistenza like :stato '+
'and accettazioneanno = :anno';
Params.ParamByName('CLIENTE').AsString := combocliente.EditingText;
Params.ParamByName('STATO').AsString := '%' + 'RIENTRATO RIPARATO' + '%';
Params.ParamByName('ANNO').AsString := comboanno.Text;
open;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This code works perfectly, thanks
with DataModule2.QAssistenze do
begin
SQL.Text :=
'select * from riparazioni where cliente = :cliente '+
'and StatoAssistenza like :stato '+
'and accettazioneanno = :anno';
Params.ParamByName('CLIENT
Params.ParamByName('STATO'
Params.ParamByName('ANNO')
open;
end;