请指点下哪里出错了
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from stock"
rs.open sql,adocon,1,3
%>
<%
if request("subb")="查询" then
session("sel")=request("sel")
session("tj")=request("tj")
session("mname")=request("mname")
end if
%>
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from stock"
'查询条件判断
if session("tj")="=" then
sql="select * from stock where "&session("sel")&" = '"&session("mname")&"'"
end if
if session("tj")="like" then
sql="select * from stock where "&session("sel")&" like '%"&session("mname")&"%'"
end if
if (session("tj")=">"and session("sel")="kcsl") then
sql="select * from stock where "&session("sel")&" > "&session("mname")&""
else if (session("tj")=">") then
sql="select * from stock where "&session("sel")&" > '"&session("mname")&"'"
end if
end if
if (session("tj")="<" and session("sel")="kcsl") then
sql="select * from stock where "&session("sel")&" < "&session("mname")&""
else if (session("tj")="<") then
sql="select * from stock where "&session("sel")&" < '"&session("mname")&"'"
end if
end if
rs.open sql,adocon,1,3
%>
<%if rs.eof then
Response.Write "<script language='javascript'>alert('系统提示:暂时没有您要找的数据!');location='mytj.asp?action=good';</script>"
'response.write "<div align=center><font color=red>对不起!暂时没有您要找的数据!</font></div>"
response.end
end if
%>
<%
set rs1=server.CreateObject("adodb.recordset")
strsql="select Distinct papername,sum(befellsum) as total from stock Group By papername Having "&session("sel")&" = '"&session("mname")&"' or "&session("sel")&" like '%"&session("mname")&"%'"
rs1.open strsql,adocon,1,3
%>