Foxtable(狐表)用户栏目专家坐堂 → 汇总求助


  共有1940人关注过本帖树形打印复制链接

主题:汇总求助

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


加好友 发短信
等级:二尾狐 帖子:502 积分:3620 威望:0 精华:0 注册:2015/4/21 22:45:00
汇总求助  发帖心情 Post By:2018/8/1 17:25:00 [只看该作者]


Select Case e.DataCol.name
    Case "服务商","月份","业务类型"
        If e.DataRow.IsNull("业务类型") Then
            e.DataRow("金额") = DataTables("仓库租金").Compute("sum(成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow.IsNull("业务类型") Then
            e.DataRow("金额") = DataTables("国内物流").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("国内物流").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow.IsNull("业务类型") Then
            e.DataRow("金额") = DataTables("出库").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("出库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow.IsNull("业务类型") Then
            e.DataRow("金额") = DataTables("入库").Compute("sum(装卸成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("入库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow.IsNull("业务类型") Then
            e.DataRow("金额") = DataTables("进口账单").Compute("sum(成本合计)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("进口账单").Compute("count(报关单号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        End If
End Select

老师帮我看看,这代码咋不起作用。

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/1 17:39:00 [只看该作者]

Select Case e.DataCol.name
    Case "服务商","月份","业务类型"
        If e.DataRow("业务类型") = "xxx" Then
            e.DataRow("金额") = DataTables("仓库租金").Compute("sum(成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("金额") = DataTables("国内物流").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("国内物流").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow("业务类型") = "bbbb" Then
            e.DataRow("金额") = DataTables("出库").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("出库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow("业务类型") = "ccc" Then
            e.DataRow("金额") = DataTables("入库").Compute("sum(装卸成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("入库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        ElseIf e.DataRow("业务类型") = "abc" Then
            e.DataRow("金额") = DataTables("进口账单").Compute("sum(成本合计)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
            e.DataRow("业务量") = DataTables("进口账单").Compute("count(报关单号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" )
        End If
End Select

 回到顶部