此主题相关图片如下:qq图片20140704113444.jpg
Select Case e.DataCol.name
Case "数量","单价","存货名称","数量","金额"
If e.DataRow.Isnull("数量") Then
e.DataRow("金额") = Nothing
Else
e.DataRow("金额") = e.DataRow("单价") * e.DataRow("数量")
End If
For Each dr As DataRow In DataTables("盘点表").DataRows
' dr("本月入库数量") = 0
Next
Dim fdr As DataRow = DataTables("盘点表").Find("存货名称 ='" & e.DataRow("存货名称") & "'")
' MessageBox.show(fdr Is Nothing)
If fdr IsNot Nothing Then
Dim d As Date = new Date(Date.Today.Year,Date.Today.Month,1)
' MessageBox.show(DataTables("进仓").Compute("sum(数量)","存货名称 ='" & e.DataRow("存货名称") & "' And 日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#"))
fdr("本月入库数量") = DataTables("进仓").Compute("sum(数量)","存货名称 ='" & e.DataRow("存货名称") & "' And 日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#")
End If
Case "日期"
e.DataRow("年月")= Format(e.DataRow("日期"),"yyyyMM")
End Select
请问我的代码错在哪了,为什么不能统计呢?