Dim flt As String = "日期 >= #1/1/2013# and 日期 <= # 1/31/2013#" For each dr As DataRow in DataTables("表B") dr("数量") = DataTables("表A").Compute("sum(数量)", flt & " And 编号 = '" & dr("编号") & "' 产品名称 = '" & dr("产品名称") & "' And 区域 = '" & dr("区域") & "'") Next