Foxtable(狐表)用户栏目专家坐堂 → [求助]统计结果有错


  共有2007人关注过本帖平板打印复制链接

主题:[求助]统计结果有错

帅哥哟,离线,有人找我吗?
huhu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1165 积分:8129 威望:0 精华:0 注册:2015/3/30 10:44:00
[求助]统计结果有错  发帖心情 Post By:2016/1/4 10:57:00 [只看该作者]

If e.DataCol.name = "入库单号" Then
    If e.DataRow.GetChildRows("预入库单").Count = 0 Then
        Dim ddr As DataRow = DataTables("预入库单").Find ("预入库单号 = '" & e.DataRow("入库单号") & "' and 行号 = '" & e.DataRow("行号") & "'")
        If ddr IsNot Nothing Then
            If ddr("预入库单号") = e.DataRow("入库单号")
                Dim sum As Integer
                sum = DataTables("工单明细").Compute("sum(预入库数量)","入库单号 = '" & ddr("预入库单号") & "' and 行号 = '" & e.DataRow("行号") & "'")
                ddr("总数量") = sum
            End If
        Else
            Dim dr As DataRow = DataTables("预入库单").AddNew()
            dr("预入库单号") = e.DataRow("入库单号")
            dr("总数量") = e.DataRow("预入库数量")
            dr("行号") = e.DataRow("行号")
        End If
    End If
End If

请问这段代码哪里有错?怎么在预入库单统计的总数量与工单明细的预入库数量不相等呢?

 回到顶部