以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  这是什么情况?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=131368)

--  作者:kljbdjz
--  发布时间:2019/2/24 16:21:00
--  这是什么情况?

图片点击可在新窗口打开查看此主题相关图片如下:11.jpg
图片点击可在新窗口打开查看


代码如下:
设置的是DataColChanged某一列的内容被更改后执行,此时列的内容已经是更改后的值。
If e.DataCol.Name = "日期" Then 
    e.DataRow("消费") = DataTables("消费表").Compute("sum(朋友圈_消费)","[日期] = \'" & e.NewValue & "\'")
    e.DataRow("总询盘") = DataTables("询盘表").Compute("count(编号)","[询盘日期] = \'" & e.NewValue & "\' AND [询盘来源] = \'朋友圈\'")
    e.DataRow("有效") = DataTables("询盘表").Compute("count(有效否)","[询盘日期] = \'" & e.NewValue & "\' AND [询盘来源] = \'朋友圈\' AND [有效否] = \'有\'")
    e.DataRow("无效") = DataTables("询盘表").Compute("count(有效否)","[询盘日期] = \'" & e.NewValue & "\' AND [询盘来源] = \'朋友圈\' AND [有效否] = \'无\'")
    e.DataRow("待定") = DataTables("询盘表").Compute("count(有效否)","[询盘日期] = \'" & e.NewValue & "\' AND [询盘来源] = \'朋友圈\' AND [有效否] = \'待定\'")
    e.DataRow("有效率") = DataTables("朋友圈日报").Compute("sum(有效)","[日期] = \'" & e.NewValue & "\'") / DataTables("朋友圈日报").Compute("sum(总询盘)","[日期] = \'" & e.NewValue & "\'") 
    e.DataRow("录入成本") = DataTables("朋友圈日报").Compute("sum(消费)","[日期] = \'" & e.NewValue & "\'") / DataTables("朋友圈日报").Compute("sum(总询盘)","[日期] = \'" & e.NewValue & "\'") 
    e.DataRow("有效成本") = DataTables("朋友圈日报").Compute("sum(消费)","[日期] = \'" & e.NewValue & "\'") / DataTables("朋友圈日报").Compute("sum(有效)","[日期] = \'" & e.NewValue & "\'") 
End If

--  作者:有点甜
--  发布时间:2019/2/24 20:47:00
--  

日期条件,请用##包裹,而不是单引号,如

 

e.DataRow("消费") = DataTables("消费表").Compute("sum(朋友圈_消费)","[日期] = #" & e.NewValue & "#")

 

http://www.foxtable.com/webhelp/scr/1284.htm