Foxtable(狐表)用户栏目专家坐堂 → 以日期定条件跨表汇总-已解決


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

主题:以日期定条件跨表汇总-已解決

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


加好友 发短信
等级:五尾狐 帖子:1128 积分:11035 威望:0 精华:2 注册:2008/9/1 10:45:00
  发帖心情 Post By:2013/5/9 7:59:00 [显示全部帖子]

Dim dt As  Row = Tables("主页").Current
Dim dt1 As Date =dt("开始日")
Dim dt2 As Date =dt("截止日")
If e.DataCol.Name = "部门" Then
    Dim nms() As String = {"执版","手雕汇总","电雕"}
    Dim sty1() As String = {"R","P","E","NL","BL","BG","H"}
    If e.NewValue Is Nothing Then
        For Each sty As String In sty1
            e.DataRow(sty) = Nothing
        Next
    Else
        For Each nm As String In nms
            For Each sty As String In sty1
                If e.NewValue = nm Then
                    e.DataRow(sty) = DataTables(nm).Compute("Sum(检数量)","款类 = '" & sty & "' and 交货期>=#" & dt1 & "# and 交货期<=#" & dt2 & "#")
                End If
            Next
        Next
    End If
End If

 回到顶部