以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  代码优化  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=110393)

--  作者:有点蓝
--  发布时间:2017/12/1 23:30:00
--  
Select Case e.DataCol.Name
    Case "合格品","不合格品"
        Dim pr As DataRow
        pr = DataTables("生产排产表").Find("加工工序 = \'" & e.DataRow("加工工序") & "\' and 成品编码 = \'" & e.DataRow("成品编码")& "\' and 生产批次 = \'" & e.DataRow("生产批次")  & "\'")
        If pr IsNot Nothing Then
            pr(e.DataCol.Name)= e.DataTable.Compute("sum(" & e.DataCol.Name & ")", "加工工序 = \'" & e.DataRow("加工工序") & "\' and 成品编码 = \'" & e.DataRow("成品编码") & "\' and 生产批次 = \'" & e.DataRow("生产批次")& "\' and _Identify <> " & e.DataRow("_Identify")) + e.DataRow(e.DataCol.Name)
        End If
End Select