我要得到小于rc0中每一个日期以前的数据总和
结果却是所有的数据总和:(rc5的值有问题)
  Set Rc0 = Rs0.OpenRecordset("select 日期, sum(净重) as 净重合计,sum(结算重量) as 结算合计 from 称重库 where 结算年份=" & FYear & "and 结算月份=" & FMonth & " group by 日期 ")
......
    ReDim Ri(Rc0.RecordCount)
    For i = 1 To Rc0.RecordCount
        
        Set Rc5 = Rs5.OpenRecordset("select sum(净重) as 本年累计 from 称重库 where 结算年份=" & List2.Text & "and 日期<=#" & Rc0!日期 & "#")
        ri(i-1)= Rc5!本年累计 
        Rc0.MoveNext
     Next i