以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请各位高手帮我看一下,下面代码中,哪里的语法存在问题。  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=24165)

--  作者:akzzwj
--  发布时间:2012/10/6 13:31:00
--  请各位高手帮我看一下,下面代码中,哪里的语法存在问题。
Select Case e.DataCol.Name
    Case "物品名称"
        e.DataRow("本月收入_数量") = DataTables("采购入库单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'") + DataTables("成品入库单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'") + DataTables("领用退回单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'")
        + DataTables("销售退货单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'")
        e.DataRow("本月发出_数量") = DataTables("领用出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") +
        DataTables("成品出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") +
        DataTables("销售出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") +
        DataTables("采购退货单细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'")
    Case "期初库存_数量","本月收入_数量","本月发出_数量"
        Dim dr As DataRow = e.DataRow
        dr("期末结存_数量") =  dr("期初库存_数量") + dr("本月收入_数量") - dr("本月发出_数量")
End Select

--  作者:czy
--  发布时间:2012/10/6 14:01:00
--  
Select Case e.DataCol.Name
    Case "物品名称"
        e.DataRow("本月收入_数量") = DataTables("采购入库单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'") + DataTables("成品入库单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'") + DataTables("领用退回单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'") + DataTables("销售退货单明细").Compute("Sum(数量)","[物品名称] = \'" & e.NewValue & "\'")
        e.DataRow("本月发出_数量") = DataTables("领用出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") +
        DataTables("成品出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") +  DataTables("销售出库单明细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'") + DataTables("采购退货单细").Compute("Sum(数量)","[物料名称] = \'" & e.NewValue & "\'")
    Case "期初库存_数量","本月收入_数量","本月发出_数量"
        Dim dr As DataRow = e.DataRow
        dr("期末结存_数量") =  dr("期初库存_数量") + dr("本月收入_数量") - dr("本月发出_数量")
End Select

--  作者:akzzwj
--  发布时间:2012/10/6 14:29:00
--  
谢谢