sql="select count(*) as hgs from Qc_V_MESMidCon where mnumber='2402014' and itemcode='138' AND ISNUMERIC(result)=1 and result>='99.2' and checkdate>='"&checkdate1&"' and checkdate<='"&checkdate2&"' "
sql_1="select count(*) as hgs from Qc_V_MESMidCon where mnumber='2402014' and itemcode='138' AND ISNUMERIC(result)=1)and checkdate>='"&checkdate1&"' and checkdate<='"&checkdate2&"' "
如何将这两条SQL语句合成一条来写?
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select count(*) as hgs from Qc_V_MESMidCon where mnumber='2402014' and itemcode='138' AND ISNUMERIC(result)=1 and result>='99.2' and checkdate>='"&checkdate1&"' and checkdate<='"&checkdate2&"' "
rs.open sql ,conn,1,3
if Not rs.EOF then
hgs=rs("hgs")
end if
rs.close
sql_1="select count(*) as jls from Qc_V_MESMidCon where mnumber='2402014' and itemcode='138' AND ISNUMERIC(result)=1 and checkdate>='"&checkdate1&"' and checkdate<='"&checkdate2&"' "
rs.open sql_1 ,conn,1,3
if Not rs.EOF then
jls=rs("jls")
end if
rs.close
%>
合格率:<td ><%=Round((hgs/jls)*100,2)&"%"%></td>
想从以上的两个SQL语句中取出的数据用来做除法,但总是提示有错!!但又不知道错在哪里?