实现多个条件综合查询 或是分别查询怎么实现,请教
请教我就是按如下代码意思写的根据这个意思编写出可按我个条件综合查询
<!--#include file="conn.asp"-->
<html>
<head>
<title></title>
</head>
<body>
<% dim sfzh,xm,xb,flag //可按身份证号或姓名或性别
sfzh=trim(request.form("sfzh"))
xm=trim(request.form("xm"))
s1="select xm ,sfzh ,xb ,dwmc ,zgbm from ryjbqk where"
if sfzh<>"" then
s1=s1&"sfzh='"&sfzh&"'"
flag=1
end if
if xm<>"" and flag=1 then
s1=s1&"and xm like '%"&xm&"%'"
flag=1
else if xm<>"" then
s1=s1&"xm like '%"&xm&"%'"
flag=1
end if
rs.open s1,conn,1,1
if not rs.eof then%>
<TABLE>
<%do while not rs.eof %>
<TR align=middle>
<% for i=0 to rs.fields.count-1%>
<td ><%=rs(i).value%></td>
<% next%>
</TR>
<% rowcount=rowcount-1
rs.movenext
loop
rs.close
set rs=nothing%>
</TABLE>
<% end if%>
</body>
</html>