以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 按照年月日 统计 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=121024) |
-- 作者:yifan3429 -- 发布时间:2018/6/27 17:56:00 -- 按照年月日 统计 Dim cmd As New SQLCommand Dim dt As DataTable cmd.C \'数据源 cmd.CommandText = 日期 From {订单表}" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt,"日期", "", "日期 DESC") For Each nd As WinForm.TreeNode In trv.AllNodes Select Case nd.Level Case 0 nd.text = nd.name & "(" & DataTables("订单表").Compute("sum(年)","年=\'" & nd.name & "\'") & "元)" Case 1 nd.text = nd.name & "(" & DataTables("订单表").Compute("sum(年)", "年=\'" & nd.parentNode.name & "\' and 月=\'" & nd.name & "\'") & "元)" Case 2 nd.text = nd.name & "(" & DataTables("订单表").Compute("sum(月)","月=\'" & nd.parentNode.parentNode.name & "\' and 日=\'" & nd.parentNode.name & "\' and = \'" & nd.name & "\'") & "元)" End Select Next trv.Nodes.Insert("全部客元", "全部客元(" & DataTables("订单表").Compute("count(用元姓名)") & ")元", 0) [此贴子已经被作者于2018/6/27 17:56:57编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/6/27 17:59:00 -- 参考
http://www.foxtable.com/webhelp/scr/2741.htm
http://www.foxtable.com/webhelp/scr/2742.htm
|