主要是这部分代码,现在关键的问题是nowjggr、nowpggr取不到值,帮我看下,我对字段求和不甚了解
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
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