以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  统计问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=80342)

--  作者:133198609
--  发布时间:2016/1/21 8:32:00
--  统计问题
If e.DataCol.name = "项目_项目_甲" Then
    Select Case e.DataRow("项目_项目_甲")
        Case "总  计"
            e.DataRow("合计_合计_a") = DataTables("员工花名册").compute("count(_Identify)","身份 = \'干部\' and 企业管理人员职务 <> \'\'")
            e.DataRow("配置方式_委任和直接聘任_b") = DataTables("员工花名册").compute("count(_Identify)", "身份 = \'干部\' and 任职方式 in (\'委任\',\'聘任\',\'聘用\')")
            e.DataRow("配置方式_选任_c") = DataTables("员工花名册").Compute("count(_identify)","任职方式 = \'选任\' and 身份 = \'干部\'")
            e.DataRow("配置方式_市场化选聘_d") = DataTables("员工花名册").Compute("count(_identify)","任职方式 = \'市场化选聘\'")


我的这一段代码,在统计的时候“身份=干部”这一项不能统计,但是改成“身份证<>干部”就可以统计,不知道问题出在哪里……

--  作者:大红袍
--  发布时间:2016/1/21 9:18:00
--  

说明你身份列,没有干部这种数据。或者多了空格之类的,试试

 

e.DataRow("配置方式_选任_c") = DataTables("员工花名册").Compute("count(_identify)","任职方式 = \'选任\' and 身份 like \'%干部%\'")

 

 


--  作者:133198609
--  发布时间:2016/1/21 12:56:00
--  
排除空格,排除没有干部。
--  作者:133198609
--  发布时间:2016/1/21 12:57:00
--  
如附件
--  作者:大红袍
--  发布时间:2016/1/21 14:17:00
--  

没看到你上传的实例。

 

上传参考 http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=67187