以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  父表统计子表数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188562)

--  作者:13678391902
--  发布时间:2023/9/27 15:01:00
--  父表统计子表数据
If e.DataCol.Name = "申报年度" OrElse e.DataCol.Name = "卷号" Then
    e.DataRow("岗位个数_女性") = DataTables("开发登记").Compute("count(性别)","申报年度=\'" & e.DataRow("申报年度") & "\' and 卷号=\'" & e.DataRow("卷号") & "\' and [性别] = \'女\'")
    e.DataRow("岗位个数_男性") = DataTables("开发登记").Compute("count(性别)","申报年度=\'" & e.DataRow("申报年度") & "\' and 卷号=\'" & e.DataRow("卷号") & "\' and [性别] = \'男\'")
End If
岗位个数:数量=女性+男性(2022 卷号001=3人、002=14人。2021,001卷3人,002卷2人才对。怎么设置??
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2023/9/27 15:03:00
--  
代码没有问题。应该是数据有问题
--  作者:13678391902
--  发布时间:2023/9/27 18:11:00
--  
我是想问一下,岗位个数-数量的代码怎么加进去?


--  作者:有点蓝
--  发布时间:2023/9/28 8:42:00
--  


If e.DataCol.Name = "申报年度" OrElse e.DataCol.Name = "卷号" Then
    e.DataRow("岗位个数_女性") = DataTables("开发登记").Compute("count(性别)","申报年度=\'" & e.DataRow("申报年度") & "\' and 卷号=\'" & e.DataRow("卷号") & "\' and [性别] = \'女\'")
    e.DataRow("岗位个数_男性") = DataTables("开发登记").Compute("count(性别)","申报年度=\'" & e.DataRow("申报年度") & "\' and 卷号=\'" & e.DataRow("卷号") & "\' and [性别] = \'男\'")
e.DataRow("岗位个数-数量") = e.DataRow("岗位个数_女性")  + e.DataRow("岗位个数_男性")
End If