下面三条有没有办法合并一条啊?我用for只能一条
sql2="select * from NF_telBook where p_del='0' and p_je<>'0' and year(p_date)='"&y&"' and month(p_date)='1' and p_mc='"&kh1&"'"
rs.Open sql2,conn,3,3
if rs.eof and rs.bof then
p_p01=0
p_p1=0
else
p_p01=0
p_p1=0
end if
do while not rs.eof
p_p01=p_p01+rs("p_je")
rs.movenext
loop
rs.close
sql3="select * from NF_telBook where p_del='0' and p_je<>'0' and year(p_date)='"&y&"' and month(p_date)='2' and p_mc='"&kh1&"'"
'end if
rs.Open sql3,conn,3,3
if rs.eof and rs.bof then
p_p02=0
p_p1=0
else
p_p02=0
p_p1=0
end if
do while not rs.eof
p_p02=p_p02+rs("p_je")
rs.movenext
loop
rs.close
sql4="select * from NF_telBook where p_del='0' and p_je<>'0' and year(p_date)='"&y&"' and month(p_date)='3' and p_mc='"&kh1&"'"
'end if
rs.Open sql4,conn,3,3
if rs.eof and rs.bof then
p_p03=0
p_p1=0
else
p_p03=0
p_p1=0
end if
do while not rs.eof
p_p03=p_p03+rs("p_je")
rs.movenext
loop
rs.close