以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]关于fill的数据问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=153545) |
-- 作者:81538475 -- 发布时间:2020/8/14 14:02:00 -- [求助]关于fill的数据问题 同样的se\\ect 命令。但是SQL查询出来的结果和 fill到表格的结果确不同,这是什么原因呢? SQL查询: se\\ect 姓名,sum(ISNULL(人天,0)) as 人天, sum(ISNULL(超期人天,0)) as 超期人天 from (Se\\ect 姓名,case when 转移 > \'1\' then 当月人天 else 0 end as 超期人天 ,case when 转移 is null or 转移<=1 then 当月人天 else 0 end as 人天 ,转移 from {XMFP} Inner JOIN {人员信息表} ON {人员信息表}.[姓名] = {XMFP}.[成员] Inner JOIN {XMZB} ON {xmZB}.[BH] = {XMFP}.[BH] Where 成员=\'AA\' and 任务开始 >= \'2020-07-01\' and 任务开始 <= \'2020-07-31\' and 代号 <> \'练习\')CQ group by 姓名窗口表fill: Dim dyrt As String ="se\\ect 姓名,sum(ISNULL(人天,0)) as 人天, sum(ISNULL(超期人天,0)) as 超期人天 from (Se\\ect 姓名,case when 转移 > \'1\' then 当月人天 else 0 end as 超期人天 ,case when 转移 is null or 转移<=1 then 当月人天 else 0 end as 人天 ,转移 from {XMFP} Inner JOIN {人员信息表} ON {人员信息表}.[姓名] = {XMFP}.[成员] Inner JOIN {XMZB} ON {xmZB}.[BH] = {XMFP}.[BH] Where 成员=\'AA\' and 任务开始 >= \'2020-07-01\' and 任务开始 <= \'2020-07-31\' and 代号 <> \'练习\')CQ group by 姓名 " \'----当月人天,加入超期算 Tables("财务工具_Table1").Fill( dyrt ,"数据源名称",True) 最后的结果 |
-- 作者:81538475 -- 发布时间:2020/8/14 14:08:00 -- 简化一点,也是一样的结果 se、ect 成员,sum(ISNULL(当月人天,0)) as 人天 from {XMFP} Where 成员=\'AA\' and 任务开始 >= \'2020-07-01\' and 任务开始 <= \'2020-07-31\' group by 成员 但是分开计算又是对的。 Dim dyrt As String ="se、ect 成员,当月人天 as 人天 from {XMFP} Where 成员=\'洪叶\' and 任务开始 >= \'2020-07-01\' and 任务开始 <= \'2020-07-31\' " \'----当月人天,加入超期算 Tables("财务工具_Table1").Fill( dyrt ,"渲奇表格数据",True) [此贴子已经被作者于2020/8/14 14:11:08编辑过]
|
-- 作者:有点蓝 -- 发布时间:2020/8/14 14:17:00 -- 应该是精度的问题。把当月人天列改为高精度类型 |
-- 作者:81538475 -- 发布时间:2020/8/14 14:33:00 -- 恩 。好了。确实是精度问题。 |