Select Case e.DataCol.name Case "销售","数量","赠品" For Each xm As String In e.DataRow("销售").split("|") Dim dr As DataRow = DataTables("月统计").find("销售 = '" & xm & "' and 年月 = '" & e.DataRow("年月") & "'") If dr IsNot Nothing Then dr("数量") = DataTables("记录").Compute("sum(数量)","销售 like '*" & xm & "*' and 年月 = '" & e.DataRow("年月") & "'") dr("赠品") = DataTables("记录").Compute("sum(赠品)","销售 like '*" & xm & "*' and 年月 = '" & e.DataRow("年月") & "'") End If Next For Each xm1 As String In e.DataRow("销售").split("|") Dim dr1 As DataRow = DataTables("日统计").find("销售 = '" & xm1 & "' and 日期 = '" & e.DataRow("日期") & "'") If dr1 IsNot Nothing Then dr1("数量") = DataTables("记录").Compute("sum(数量)","销售 like '*" & xm1 & "*' and 日期 = '" & e.DataRow("日期") & "'") dr1("赠品") = DataTables("记录").Compute("sum(赠品)","销售 like '*" & xm1 & "*' and 日期 = '" & e.DataRow("日期") & "'") End If Next End Select
|