汇总结果取不到值,请指教,问题应该在末端代码中,但是我看不出来
代码运行结果目标:写入数据库N条数据后汇总一次,结束汇总结果取不到值,请指教,问题应该在末端代码中,但是我看不出来
<%
if request("hid1")="ok" then
nowselldate=request("selldate")
nowenddate=request("enddate")
nowbeizhu=request("beizhu")
nowprice=request("price")
nowbzr=request("bzr")
nowtype=request("type")
nowid_danwei=request("id_danwei")
nowid_produit=request("id_produit")
nowid_huiyuan=request("id_huiyuan")
nowid_login=request("id_login")
set rs_login=conn.execute("select * from login where id="&nowid_login)
nowid_ku=request("id_ku")
set rs_ku=conn.execute("select * from ku where id="&nowid_ku)
nowid_gys=request("id_gys")
nowgys=request("gys")
nowjxf=request("jxf")
nowybf=request("ybf")
nowgrxs=request("grxs")
nowfcf=request("fcf")
nowaqf=request("aqf")
nowgj=request("gj")
nowbianhao=replace(replace(replace(replace(replace(replace(FormatDateTime(now(),0),":","")," ",""),"-",""),"/",""),"上午",""),"下午","")
'totalshulian=0
for x=1 to maxproduit
nowhuohao=request("huohao"&x)
nowtitle=request("title"&x)
nowshulian=request("shulian"&x)
nowid_danwei=request("id_danwei"&x)
nowprice2=request("price2"&x)
nowprice1=request("price1"&x)
nowbigclass=request("bigclass"&x)
if nowprice2="" then
nowprice2=0
end if
if nowprice1="" then
nowprice1=0
end if
if nowshulian="" then
nowshulian=0
end if
if nowhuohao<>"选择定额" and nowshulian<>"" then
set rs_dek=conn.execute("select * from dek where debh='"&nowhuohao&"'")
set rs=server.createobject("ADODB.RecordSet")
sql="select * from b3j where 1=2"
rs.open sql,conn,1,3
rs.addnew
rs("huohao")=nowhuohao
rs("title")=nowtitle
rs("shulian") =nowshulian
rs("id_danwei")=nowid_danwei
rs("price1")=nowprice1
rs("price2")=nowprice2
rs("bigclass")=nowbigclass
rs("id_gys")=nowid_gys
rs("id_produit")=nowid_produit
rs("id_huiyuan")=nowid_huiyuan
rs("price")=nowprice
rs("id_ku")=nowid_ku
rs("bzr")=nowbzr
rs("gys")=nowgys
rs("type")=nowtype
rs("selldate")=nowselldate
rs("enddate")=nowenddate
rs("id_login")=nowid_login
rs("login")=rs_login("username")
rs("bianhao")=nowbianhao
rs("beizhu")=nowbeizhu
rs("ybf")=nowybf
rs("jxf")=nowjxf
rs("grxs")=nowgrxs
rs("fcf")=nowfcf
rs("aqf")=nowaqf
rs("gj")=nowgj
rs("jggr")= nowprice1*nowshulian
rs("pggr")= nowprice2*nowshulian
rs.update
end if
next
set count_b3j = server.createobject("ADODB.RecordSet")
count_b3j.open sql,conn,1,3
nowjggr=0
nowpggr=0
do while count_b3j.eof=false
sql3="select sum(jggr),sum(pggr) from b3j where bianhao='"&nowbianhao&"' "
set rs_sum=conn.execute(sql3)
nowjggr=nowjggr+rs_sum(0)
nowpggr=nowpggr+rs_sum(1)
count_b3j.movenext
loop
set rs2=server.createobject("ADODB.RecordSet")
sql="select * from b3j where bianhao='"&nowbianhao&"'"
rs2.open sql,conn,1,3
do while rs2.eof=false
rs2.addnew
rs2("bianhao")=nowbianhao
rs2("title")="---[工日小计]---"
rs2("jggr")=nowjggr 汇总结果取不到值
rs2("pggr")=nowpggr 汇总结果取不到值
rs2.movenext
loop
%>