以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 统计非空单元格数据 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=76047) |
|
-- 作者:kaituozhe -- 发布时间:2015/10/20 16:54:00 -- 统计非空单元格数据 我想统计甲公司银行中对方账号为空的借方金额,编写了以下,提示错误,这个代码该怎么写 e.DataRow("借方")=DataTables("甲公司银行").SQLCompute("sum("借方金额")","对方账号= \'" & & "\'") |
|
-- 作者:大红袍 -- 发布时间:2015/10/20 16:55:00 -- e.DataRow("借方")=DataTables("甲公司银行").SQLCompute("sum("借方金额")","对方账号 is null") |
|
-- 作者:kaituozhe -- 发布时间:2015/10/20 17:00:00 --
.NET Framework 版本:2.0.50727.5485 |
|
-- 作者:大红袍 -- 发布时间:2015/10/20 17:09:00 -- 没有你这种写法 isnot
要写就这样写
e.DataRow("借方")=DataTables("甲公司银行").SQLCompute("sum(借方金额)","对方账号 is not null") |
|
-- 作者:kaituozhe -- 发布时间:2015/10/20 17:12:00 -- e.DataRow("借方")=DataTables("甲公司银行").SQLCompute("sum(借方金额)","对方账号 is not null")这样写代码提示如下:
.NET Framework 版本:2.0.50727.5485 |
|
-- 作者:大红袍 -- 发布时间:2015/10/20 17:17:00 -- 说明你表里面列不存在。表达式列不能直接用sqlcompute |
|
-- 作者:kaituozhe -- 发布时间:2015/10/20 18:15:00 -- e.DataRow("借方")=DataTables("甲公司银行").SQLCompute("sum(借方金额)","对方账号 is not null") 用以上代码计算 对方账号列有2万多行,甲公司银行明细有几十万行,上述公式直接导致系统死机,有没有更好一点的解决办法。 |
|
-- 作者:大红袍 -- 发布时间:2015/10/20 18:17:00 -- 不要循环使用SqlCompute。每次计算都是很耗时的。
你还不如先生成分组统计表,然后直接查统计表。 |