Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:父表统计子表数据

1楼
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人才对。怎么设置??
图片点击可在新窗口打开查看
2楼
有点蓝 发表于:2023/9/27 15:03:00
代码没有问题。应该是数据有问题
3楼
13678391902 发表于:2023/9/27 18:11:00
我是想问一下,岗位个数-数量的代码怎么加进去?

4楼
有点蓝 发表于: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
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02246 s, 2 queries.