Select yy_id from your_datatable Where oer=Label01.caption
select yy_id from table where oer=label01.caption
procedure TForm1.Button1Click(Sender: TObject); begin QUERY1.CLOSE; QUERY1.SQL.Clear; QUERY1.SQL.Add('select yy_id from table where oer='+label01.caption); QUERY1.OPEN; SHOWMESSAGE(QUERY1.FieldValues['yy_id']); end;
adoquery1.sql.add('select yyid from tablename where oer='+''''+label101.caption+''''); adoquery1.open; OK!!!!!
begin
QUERY1.CLOSE;
QUERY1.SQL.Clear;
QUERY1.SQL.Add('select yy_id from table where oer='+label01.caption);
QUERY1.OPEN;
SHOWMESSAGE(QUERY1.FieldValues['yy_id']);
end;
adoquery1.open;
OK!!!!!