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


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

主题:[求助]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/4/9 18:19:00 [显示全部帖子]

没看懂你要做什么,请具体说明你要做到的效果

 

        Dim drs As List(of DataRow)
        Dim Filter As String
        Dim d1 As Date = e.DataRow("付款日期")
        d1 = new Date(d1.Year, d1.Month, 1)
        Dim d2 As Date = d1.AddMonths(1)
        Filter = "[付款日期] >= #" & d1 & "# and 付款日期 < #" & d2 & "# And [户名] = '" & e.DataRow("户名") & "'"
        drs = e.DataTable.Select(Filter)
        For Each dr As DataRow In drs
            Filter = "[付款日期] <= #" & e.DataRow("付款日期") & "# and 付款日期 >= #" & d1 & "# And [户名] = '" & e.DataRow("户名") & "'"
            Dim Val1 As Double = e.DataTable.Compute("Sum(实付金额)",Filter)
            dr("实付金额") = Val1
        Next


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/4/10 11:27:00 [显示全部帖子]

加一列【累计实付金额】,然后显示累计结果,如

 

       Dim drs As List(of DataRow)
        Dim Filter As String
        Dim d1 As Date = e.DataRow("付款日期")
        d1 = new Date(d1.Year, d1.Month, 1)
        Dim d2 As Date = d1.AddMonths(1)
        Filter = "[付款日期] >= #" & d1 & "# and 付款日期 < #" & d2 & "# And [户名] = '" & e.DataRow("户名") & "'"
        drs = e.DataTable.Select(Filter, "付款日期,_sortkey")
        For Each dr As DataRow In drs
            Filter = "[付款日期] <= #" & e.DataRow("付款日期") & "# and 付款日期 >= #" & d1 & "# And [户名] = '" & e.DataRow("户名") & "'"
            Dim Val1 As Double = e.DataTable.Compute("Sum(实付金额)",Filter)
            dr("累计实付金额") = Val1
        Next


 回到顶部