主题:  在线跪求高手帮助!!

冬天来了

职务:普通成员
等级:1
金币:0.0
发贴:2
#12003/11/5 10:14:10

图片如下:



我想计算ncomid=1, bgood=1的总数减去ncomid=1, bgood=2总数的值
写了下面的程序,总提示不正确谁来帮我!!



set rs_good=server.createobject("adodb.recordset")
sql_good="select nComId,count(bGood) as totals1 from appraisal where bGood=1 group by nComId "
rs_good.open sql_good,mConn,1,1
if not rs_good.eof then

Good=rs_good("totals1")
'response.write rs_good("totals1")
'response.end
else
Good=0
end if

set rs_bad=server.createobject("adodb.recordset")
sql_bad="select nComId,count(bBad) as totals2 from appraisal where bGood=2 group by nComId "
rs_bad.open sql_bad,mConn,1,1
if not rs_bad.eof then
Bad=rs_bad("totals2")

else
Bad=0
end if

Source=Good-Bad



我有BLOG了

职务:普通成员
等级:4
金币:16.8
发贴:2209
#22003/11/6 16:30:16
我也没看明白,期待高手回答