以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 自动选择日期,根据日期自动统计另外一个表“分类”总和以及占比; (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=135819) |
||||
-- 作者:zerozm -- 发布时间:2019/6/3 20:42:00 -- 自动选择日期,根据日期自动统计另外一个表“分类”总和以及占比; 自动选择日期,根据日期自动统计另外一个表“分类”总和以及占比; 先解决手动选择日期。(后期就每周或每天自动统计信息,发送到钉钉) ![]() ![]() ![]() ![]() 谢谢。 已购买高开,但还没有使用。 用内部数据库后以后将要用 SQL 数据库;对于本表有什么区别。请一并指出。谢谢各位老师。
|
||||
-- 作者:有点蓝 -- 发布时间:2019/6/3 21:09:00 -- 例如,表B,datacolchanged事件 Select Case e.DataCol.Name Case "起点时间","结束时间" If e.DataRow.IsNull("起点时间") OrElse e.DataRow.IsNull("结束时间") Then e.DataRow("A组总收入") = Nothing e.DataRow("B组总收入") = Nothing Else e.DataRow("A组总收入") = DataTables("表A基础数据").Compute("sum(收入)","立项时间 >= \'" & e.DataRow("起点时间") & "\' And 立项时间 <=\'" & e.DataRow("结束时间") & "\' and 组别=\'A组\'") e.DataRow("B组总收入") = DataTables("表A基础数据").Compute("sum(收入)","立项时间 >= \'" & e.DataRow("起点时间") & "\' And 立项时间 <=\'" & e.DataRow("结束时间") & "\' and 组别=\'B组\'") End If Case "B组总收入","A组总收入","C组总收入","D组总收入" Dim sum As Double = e.DataRow("A组总收入") + e.DataRow("B组总收入") + e.DataRow("C组总收入") + e.DataRow("D组总收入") If sum > 0 Then e.DataRow("A组收入占比") = e.DataRow("A组总收入")/sum Else e.DataRow("A组收入占比") =0 End If End Select |
||||
-- 作者:zerozm -- 发布时间:2019/6/4 19:34:00 -- 老师,有错误,是不是 引号 哪里错了。。太复杂。
会不会是 起点时间,结束时间 不是 在“表A基础数据”的列; 而是 表B 的列 ??? 目前用的是 内部数据源,等调试好了,我再转成 SQL。 [此贴子已经被作者于2019/6/4 19:48:11编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2019/6/4 20:25:00 -- 把收入列改为双精度列 |