以文本方式查看主题

-  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=120770)

--  作者:紫色幽魂
--  发布时间:2018/6/23 11:32:00
--  [求助]怎样获取符合条件的子表关联行的行数
请问怎样获取符合条件的子表关联行的行数?
--  作者:有点蓝
--  发布时间:2018/6/23 12:01:00
--  
Dim cnt As Integer
cnt
 = DataTables("子表").Compute("Count([客户])""关联列 = \'" & 主表dr("关联列") & "\' and 雇员 = \'EP01\' And 数量 > 500")
Output
.Show("订单数:" & cnt)
--  作者:紫色幽魂
--  发布时间:2018/6/23 14:28:00
--  回复:(有点蓝)Dim cnt As Integerc...
下午一直改还是没有改正确
麻烦帮我看看
也就是子表如果的检测状态全部完结了,那么主表的检测状态栏也就完结,否则主表检测状态栏为空
If e.DataCol.name = "检测状态" Then
    Dim pr As DataRow = e.DataRow.GetParentRow("无损_工程主表")
    If pr IsNot Nothing Then
        Dim cnt As Integer
        cnt = DataTables("无损_检验批").Compute("Count("工程编号")", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 isnot nothing")
        If pr.Count = cn Then
            pr("检测状态") = "完结"
        Else
            pr("检测状态") = ""
        End If
    End If
End If


--  作者:有点蓝
--  发布时间:2018/6/23 14:58:00
--  
cnt = DataTables("无损_检验批").Compute("Count("工程编号")", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 is null")

If cnt  = 0 Then
            pr("检测状态") = "完结"
        Else
            pr("检测状态") = ""
        End If

--  作者:紫色幽魂
--  发布时间:2018/6/23 15:15:00
--  
我写在无损_检验批表的数据变动后的事件中提示我错误,不能保存,是怎么回事呢
If e.DataCol.name = "检测状态" Then
    Dim pr As DataRow = e.DataRow.GetParentRow("无损_工程主表")
    If pr IsNot Nothing Then
        Dim cnt As Integercnt = DataTables("无损_检验批").Compute("Count("工程编号")", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 is null")

If cnt = 0 Then
            pr("检测状态") = "完结"
        Else
            pr("检测状态") = ""
        End If
    End If
End If

--  作者:有点蓝
--  发布时间:2018/6/23 15:27:00
--  
Dim cnt As Integer =  DataTables("无损_检验批").Compute("Count("工程编号")", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 is null")
--  作者:紫色幽魂
--  发布时间:2018/6/23 16:58:00
--  回复:(有点蓝)Dim cnt As Integer =  DataTab...
下午停电,我在前面定义了这个类型,手机上编辑的时候漏了,Dim cnt As Integer,这个是单独一排的
--  作者:有点蓝
--  发布时间:2018/6/23 17:41:00
--  
提示什么错误?
--  作者:紫色幽魂
--  发布时间:2018/6/25 9:02:00
--  回复:(有点蓝)提示什么错误?
写在无损_检验批表单的DataColChanged事件提示这个
编译错误:没有可访问的“Compute”接受此数目的参数,因此重载决策失败。
错误代码:cnt=DataTables("无损检验批").Compute("Count(“工程编号")","工程编号="&pr("工程编号”)&""and 检测状态 is null")
(图片不知怎么上传不了)

If e.DataCol.name = "检测状态" Then
    Dim pr As DataRow = e.DataRow.GetParentRow("无损_工程主表")
    If pr IsNot Nothing Then
        Dim cnt As Integer
        cnt = DataTables("无损_检验批").Compute("Count("工程编号")", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 is null")
        If cnt  = 0 Then
            pr("检测状态") = "完结"
        Else
            pr("检测状态") = ""
        End If
    End If
End If
[此贴子已经被作者于2018/6/25 9:03:46编辑过]

--  作者:有点甜
--  发布时间:2018/6/25 9:26:00
--  
cnt = DataTables("无损_检验批").Compute("Count(工程编号)", "工程编号 = \'" & pr("工程编号") & "\' and 检测状态 is null")