以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 统计问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=33381) |
-- 作者:实话实说 -- 发布时间:2013/5/17 7:02:00 -- 统计问题 以下代码红色部分提示错误,谁能帮我修正,先谢了。 DataTables("导体报表").DataRows.Clear Dim s As String = e.Form.Controls("月份").Value If s <> "" Then Dim f As New Filler f.SourceTable = DataTables("导体明细") f.DataTable = DataTables("导体报表") f.ExcludeExistValue = True f.Filter = "月份 = \'" & s & "\'" f.Fill() For Each dr As DataRow In DataTables("导体报表").DataRows Dim s1 As String = "导体分类 = \'" & dr("导体分类") & "\' And 规格 = \'" & dr("规格") & "\' And 月份 = \'" & s & "\'" dr("车间领料") = DataTables("导体明细").Compute("Sum(产量)",s1 And "用户 = \'购进\' ") \'dr("本月入仓") = DataTables("线缆导体明细").Compute("Sum(入仓数量)",s1) \'dr("本月出仓") = DataTables("线缆导体明细").Compute("Sum(出仓数量)",s1) s1 = "规格 = \'" & dr("规格") & "\' And 月份 < \'" & s & "\'" \'dr("上月结存") = DataTables("线缆导体明细").Compute("Sum(入仓数量)",s1) - DataTables("线缆导体明细").Compute("Sum(出仓数量)",s1) \'dr("本月结存") = dr("上月结存") + dr("本月入仓") - dr("本月出仓") Next End If DataTables("导体报表").DeleteFor(" [规格] is null " ) |
-- 作者:lsy -- 发布时间:2013/5/17 7:29:00 -- dr("车间领料") = DataTables("导体明细").Compute("Sum(产量)",s1 & " And 用户 = \'购进\' ")
|