X
xiejiangbo
Unregistered / Unconfirmed
GUEST, unregistred user!
我要实现部门和年月同时查询,该如何写代码,我是这样写的
begin
if radiobutton1.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where gh='''+trim(edit1.Text)+''' ' );
end;
if radiobutton2.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where xm like ''%'+trim(edit2.Text)+'%'' ' );
end;
if radiobutton3.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where bumen like ''%'+trim(ComboBox1.Text)+'%'' ' );
end;
if radiobutton4.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where yyue like ''%'+trim(ComboBox2.Text)+'%'' ' );
end;
if fk.ADOQuery1.RecordCount=0 then
showmessage('查无此员工!');
他们都是单一查询,如工号/姓名/部门/年月,请问大侠们,[red]我如何大侠们怎样才能把部门与年月结合起来查询,达到查询出同年月和同部门的记录呢,急用,谢谢!!![/red]
begin
if radiobutton1.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where gh='''+trim(edit1.Text)+''' ' );
end;
if radiobutton2.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where xm like ''%'+trim(edit2.Text)+'%'' ' );
end;
if radiobutton3.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where bumen like ''%'+trim(ComboBox1.Text)+'%'' ' );
end;
if radiobutton4.Checked then
begin
opensql(fk.ADOQuery1,'select * from yuefk where yyue like ''%'+trim(ComboBox2.Text)+'%'' ' );
end;
if fk.ADOQuery1.RecordCount=0 then
showmessage('查无此员工!');
他们都是单一查询,如工号/姓名/部门/年月,请问大侠们,[red]我如何大侠们怎样才能把部门与年月结合起来查询,达到查询出同年月和同部门的记录呢,急用,谢谢!!![/red]