以文本方式查看主题

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

--  作者:有点甜
--  发布时间:2014/9/25 12:09:00
--  

 参考代码

 

Dim str As String = "合格"

For Each dr As DataRow In DataTables("表A").Select("产品名称 like \'%" & str & "%\'")
    Dim ary() As String = dr("级序关系").split(".")
    Dim temp As String = ""
    For Each a As String In ary
        temp &= a
        Dim fdr As DataRow = DataTables("表A").Find("级序关系 = \'" & temp & "\'")
        output.Show(temp & "  " & fdr("产品名称"))
        temp &= "."
    Next
Next


--  作者:有点甜
--  发布时间:2014/9/26 17:36:00
--  

 呃,绕弯了 图片点击可在新窗口打开查看

 

Dim str As String = 1
Dim dt As DataTable = DataTables("表A")

For Each dr As DataRow In dt.Select("级序关系 like \'" & str & ".*\'")
    Dim count As Integer = dt.Compute("count(级序关系)", "级序关系 Like \'" & dr("级序关系") & ".*\'")
    If count = 0 Then
        output.Show(dr("产品名称"))
    End If
Next