以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助?这段代码怎么改?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=117204)

--  作者:zsslly
--  发布时间:2018/4/8 18:39:00
--  求助?这段代码怎么改?
If e.DataCol.name = "年度" OrElse e.DataCol.name = "操作人储备业绩" Then
    If e.DataRow.Isnull("年度") = False AndAlso e.DataRow.Isnull("操作人储备业绩") = False Then
\'不一样
         Dim filter As String

        If e.DataRow("店面") = "宁波一店"
        If e.DataRow("部门") = "设计部"
            
            filter  = "设计师 = \'" & e.DataRow("操作人储备业绩") & "\'"
        Else
            filter  = "市场部 = \'" & e.DataRow("操作人储备业绩") & "\'"
        End If
\'不一样
        For k As Integer = 1 To 12
            Dim f As Date = new Date(val(e.DataRow("年度")), k, 1)
            Dim sum As Integer = DataTables("峰和设计部").compute("sum(预签金额)", filter & " and 操作性 = \'预签\' and 预签时间 >= #" & f & "# and 预签时间 < #" & f.addmonths(1) & "#")
            e.DataRow("M" & k) = sum
        Next
    Else
        For k As Integer = 1 To 12
            e.DataRow("M" & k) = Nothing
        Next
    End If
End If


求老师指点,我添加了一个统计条件:If e.DataRow("部门") = "设计部"
不知道怎么改了?求助?

--  作者:zsslly
--  发布时间:2018/4/8 18:58:00
--  
表内截图
图片点击可在新窗口打开查看此主题相关图片如下:qq截图20180408185559.jpg
图片点击可在新窗口打开查看

--  作者:zsslly
--  发布时间:2018/4/8 19:18:00
--  
未知编译错误?

If e.DataCol.name = "年度" OrElse e.DataCol.name = "操作人储备业绩" Then
    If e.DataRow.Isnull("年度") = False AndAlso e.DataRow.Isnull("操作人储备业绩") = False Then
\'不一样
         Dim filter As String
        If e.DataRow("部门") = "设计部" 
            filter  = "店面 = \'宁波一店\' and 设计师 = \'" & e.DataRow("操作人储备业绩") & "\'"
        Else
            filter  = "店面 = \'宁波一店\' and 市场部 = \'" & e.DataRow("操作人储备业绩") & "\'"
        End If
            filter  = "店面 = \'奉化一店\' and 市场部 = \'" & e.DataRow("操作人储备业绩") & "\'"
        End If
            filter  = "店面 = \'奉化一店\' and 市场部 = \'" & e.DataRow("操作人储备业绩") & "\'"
        End If
\'不一样
        For k As Integer = 1 To 12
            Dim f As Date = new Date(val(e.DataRow("年度")), k, 1)
            Dim sum As Integer = DataTables("峰和设计部").compute("sum(预签金额)", filter & " and 操作性 = \'预签\' and 预签时间 >= #" & f & "# and 预签时间 < #" & f.addmonths(1) & "#")
            e.DataRow("M" & k) = sum
        Next
    Else
        For k As Integer = 1 To 12
            e.DataRow("M" & k) = Nothing
        Next
    End If
End If


求指点!

--  作者:有点甜
--  发布时间:2018/4/8 23:05:00
--  
If e.DataCol.name = "年度" OrElse e.DataCol.name = "操作人储备业绩" Then
    If e.DataRow.Isnull("年度") = False AndAlso e.DataRow.Isnull("操作人储备业绩") = False Then
        \'不一样
        Dim filter As String
        If e.DataRow("部门") = "设计部"
            filter  = "店面 = \'" & e.DataRow("店面") & "\' and 设计师 = \'" & e.DataRow("操作人储备业绩") & "\'"
        Else
            filter  = "店面 = \'" & e.DataRow("店面") & "\' and 市场部 = \'" & e.DataRow("操作人储备业绩") & "\'"
        End If
       
        For k As Integer = 1 To 12
            Dim f As Date = new Date(val(e.DataRow("年度")), k, 1)
            Dim sum As Integer = DataTables("峰和设计部").compute("sum(预签金额)", filter & " and 操作性 = \'预签\' and 预签时间 >= #" & f & "# and 预签时间 < #" & f.addmonths(1) & "#")
            e.DataRow("M" & k) = sum
        Next
    Else
        For k As Integer = 1 To 12
            e.DataRow("M" & k) = Nothing
        Next
    End If
End If