Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:矿石汇总00_1210.zip |
没有明白你的意思。
其实没有什么特别的,只需将DatacolChanged改为:
Select
Case
e.DataCol.Name
Case
"A","B"
原计算代码1
Case
"D","E"
原计算代码2
End
Select
If e.DataCol.Name = "日期" Orlse e.DataCol.Name = "矿点" Then
Select Case vars("HZ")
Case 1 '按日期汇总按扭
e.DataRow("一车间_车数") = DataTables("明细表").Compute("sum(车数)", "[日期] = '" & e.Datarow("日期") & "' and [车间] = '一车间'")
e.DataRow("一车间_毛重") = DataTables("明细表").Compute("sum(毛重)", "[日期] = '" & e.Datarow("日期") & "' and [车间] = '一车间'")
e.DataRow("一车间_净重") = DataTables("明细表").Compute("sum(扣杂)", "[日期] = '" & e.Datarow("日期") & "' and [车间] = '一车间'")
Case 2 '按全部矿点分日期汇总按扭
e.DataRow("一车间_车数") = DataTables("明细表").Compute("sum(车数)", "[矿点] = '" & e.Datarow("矿点") & "' and [车间] = '一车间'and [日期] >= '" & vars("date0") & "' and [日期] <= '"& vars("date1") & "' ")
e.DataRow("一车间_毛重") = DataTables("明细表").Compute("sum(毛重)", "[矿点] = '" & e.Datarow("矿点") & "' and [车间] = '一车间' and [日期] >= '" & vars("date0") & "' and [日期] <= '"& vars("date1") & "' ")
e.DataRow("一车间_净重") = DataTables("明细表").Compute("sum(扣杂)", "[矿点] = '" & e.Datarow("矿点") & "' and [车间] = '一车间' and [日期] >= '" & vars("date0") & "' and [日期] <= '"& vars("date1") & "' ")
End Select
End If