Foxtable(狐表)用户栏目专家坐堂 → 关于在窗口中统计数据的问题


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

主题:关于在窗口中统计数据的问题

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
关于在窗口中统计数据的问题  发帖心情 Post By:2020/4/9 11:40:00 [只看该作者]

老师,我在窗口中增加了TopicBar类型窗口,想统计日、周、月付款笔数和金额,以下代码没有提示错误,但统出来的数据不正确,全部为0.请老师指导,谢谢!!

Dim Page As WinForm.TopicPage
Dim cnt1 As Integer = DataTables("资金计划付款明细表").Compute("Count(_Identify)" , "rq = #"  & Date.Today & "#")
Dim cnt4 As Integer = DataTables("资金计划付款明细表").Compute("sum(支付金额)" , "rq = #"  & Date.Today & "#")
Page = e.Form.Controls("TopicBar1").Pages.Add("即时信息","即时信息")
Page.Links.Add("今日付款笔数","今日付款笔数(" & cnt1 & ")" )
Page.Links.Add("今日付款金额","今日付款金额(" & cnt4 & ")" )

Dim y As Integer = Date.Today.Year
Dim w As Integer = Date.Today.DayOfWeek '算出今天是星期几
Dim dt1 As Date = Date.Today.AddDays(-w) '获取本周的第一天
Dim dt2 As Date = Date.Today.AddDays(6 - w) '获取本周的最后一天
Dim Filter1 As String
Filter1 = "rq >= #" & dt1 & "# And rq <= #" & dt2 & "#"
Dim cnt2 As Integer = DataTables("资金计划付款明细表").Compute("Count(_Identify)" , "rq >= #" & dt1 & "# And rq <= #" & dt2 & "#")
Dim cnt3 As Integer = DataTables("资金计划付款明细表").Compute("sum(支付金额)" , "rq >= #" & dt1 & "# And rq <= #" & dt2 & "#")
Page.Links.Add("本周付款笔数","本周付款笔数(" & cnt2 & ")" )
Page.Links.Add("本周付款金额","本周付款金额(" & cnt3 & ")" )

Dim m As Integer = Date.Today.Month
Dim dt3 As New Date(y, m, 1)
Dim dt4 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim Filter2 As String
Filter2 = "rq >= #" & dt3 & "# And rq <= #" & dt4 & "#"
Dim cnt5 As Integer = DataTables("资金计划付款明细表").Compute("Count(_Identify)" , "rq >= #" & dt3 & "# And rq <= #" & dt4 & "#")
Dim cnt6 As Integer = DataTables("资金计划付款明细表").Compute("sum(支付金额)" , "rq >= #" & dt3 & "# And rq <= #" & dt4 & "#")
Page.Links.Add("本月付款笔数","本月付款笔数(" & cnt5 & ")" )
Page.Links.Add("本月付款金额","本月付款金额(" & cnt6 & ")" )

 回到顶部
总数 19 1 2 下一页