sqlserver给你个程序段where部分
procedure Tfrmquery.BitBtn1Click(Sender: TObject);
var
strI:string;
begin
strSQL:='SELECT * FROM Manager ';
if rdbname.Checked then
begin
strI:=edtName.Text;
if strI<>'' then
begin
if rdbJQ.Checked then
strI:='where Manager_Name='''+strI+''''
else
strI:='where Manager_Name like ''%'+stri+'%''';
end;
end;
if rdbUser.Checked then
begin
strI:=edtuser.Text;
if stri='' then
begin
if rdbjq.Checked then
stri:='where username='''+stri+''''
else
stri:='where username like ''%'+stri+'%''';
end;
end;
strSQL:=strSQL+strI;
self.ModalResult:=mrok;
end;