以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 同一段代码,为什么只能统计出一部分数据呢? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=32561) |
||||
-- 作者:zerov -- 发布时间:2013/5/4 9:18:00 -- 同一段代码,为什么只能统计出一部分数据呢? 如题,现在只能统计出回款类的数据,不能统计出费用的数据,这是什么? 1、这是统计效果,费用类的数据没有统计出来
2、这是费用表,明明就有安徽的费用 ![]() ![]() 3、这是代码:哪儿错了? Select e.DataCol.Name Case "分公司","期间_起始日","期间_截止日" If e.DataRow.IsNull("分公司") = False AndAlso e.DataRow.IsNull("期间_起始日") = False AndAlso e.DataRow.IsNull("期间_截止日") = False Then e.DataRow("回款_其它老") = DataTables("回款明细").Compute("sum(回款金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 <> \'承兑\' and 年份 <> 2013 ") e.DataRow("回款_其它新") = DataTables("回款明细").Compute("sum(回款金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 <> \'承兑\' and 年份 = 2013 ") e.DataRow("回款_承兑老") = DataTables("回款明细").Compute("sum(回款金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 = \'承兑\' and 年份 <> 2013 ") e.DataRow("回款_承兑新") = DataTables("回款明细").Compute("sum(回款金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 收款方式 = \'承兑\' and 年份 = 2013 ") e.DataRow("费用_经理往来") = DataTables("费用").Compute("sum(支出金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = \'经理往来\'") e.DataRow("费用_劳务费用") = DataTables("费用").Compute("sum(支出金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = \'劳务费用\'") e.DataRow("费用_内部往来") = DataTables("费用").Compute("sum(支出金额)","分公司=\'" & e.DataRow("分公司") & "\' and 日期 > #" & e.DataRow("期间_起始日") & "# and 日期 < #" & e.DataRow("期间_截止日") & "# and 费用类型 = \'内部往来\'") e.DataRow("费用_累计已付款") = e.DataRow("费用_经理往来") + e.DataRow("费用_劳务费用") + e.DataRow("费用_内部往来") e.DataRow("剩余可支配金额") = e.DataRow("回款_可支配总额") - e.DataRow("费用_累计已付款") e.DataRow("备注") = Nothing Else e.DataRow("回款_其它老") = Nothing e.DataRow("回款_其它新") = Nothing e.DataRow("回款_承兑老") = Nothing e.DataRow("回款_承兑新") = Nothing e.DataRow("费用_经理往来") = Nothing e.DataRow("费用_劳务费用") = Nothing e.DataRow("费用_内部往来") = Nothing e.DataRow("费用_累计已付款") = Nothing e.DataRow("剩余可支配金额") = Nothing e.DataRow("备注") = Nothing End If End Select |
||||
-- 作者:zerov -- 发布时间:2013/5/4 9:48:00 -- 还是不行呀,哪位大师帮我看看呀 |
||||
-- 作者:zerov -- 发布时间:2013/5/4 12:37:00 -- 回复:(muhua)把例子发上来。 例如如下: |
||||
-- 作者:zerov -- 发布时间:2013/5/4 14:40:00 -- bin或程版在不? |
||||
-- 作者:Bin -- 发布时间:2013/5/4 14:55:00 -- 你条件没拼接对.
|
||||
-- 作者:zerov -- 发布时间:2013/5/4 15:25:00 -- 回复:(Bin)你条件没拼接对.[upload=table,例子.tab... 先谢谢大师了,赶紧学习学习 |
||||
-- 作者:zerov -- 发布时间:2013/5/4 15:50:00 -- 还是不行,只能统计一行数据或两行数据,估计是“filter”出问题,没有弹出出错窗口,见下图 |
||||
-- 作者:Bin -- 发布时间:2013/5/4 16:11:00 -- 你代码本身就是写成这样的.不是统计全表,是统计选中行,你要统计那一行,点一下选中 再点确定 |
||||
-- 作者:zerov -- 发布时间:2013/5/4 16:17:00 -- 回复:(Bin)你代码本身就是写成这样的.不是统计全表... 谢谢大师指点! 弱弱地问一句,如果想一次统计全表呢?
|
||||
-- 作者:Bin -- 发布时间:2013/5/4 16:19:00 -- 循环所有行然后逐一统计即可. |