以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  查询替换  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=105177)

--  作者:qianqian1530
--  发布时间:2017/8/13 14:44:00
--  查询替换
怎么 不好使呢???


Dim Sum As Integer
For Each dar As DataRow In DataTables("Statement").DataRows
    Dim Str1 As String = dar("remarks")

    If Str1 > "" AndAlso Str1 = "s/l" Then
        Dim drs As List(Of DataRow)
        drs = DataTables("Statement").Select("[Ticket] = \'" & dar("Ticket")  & "\' And [Profit]= \'\'")
        For Each dr As DataRow In drs
            drs("Profit") = dar("Profit")
            dar("Profit")=""
        Next
    End If
Next
[此贴子已经被作者于2017/8/13 14:51:45编辑过]

--  作者:qianqian1530
--  发布时间:2017/8/13 14:46:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:草图.png
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2017/8/13 15:00:00
--  
Dim Sum As Integer
For Each dar As DataRow In DataTables("Statement").DataRows
    Dim Str1 As String = dar("remarks")
    If Str1 > "" AndAlso Str1 = "s/l" Then
        msgbox(dar("Ticket"))
        Dim drs As List(Of DataRow)
        drs = DataTables("Statement").Select("[Ticket] = \'" & dar("Ticket")  & "\' And ([Profit]= \'\' or [Profit] is null)")
        For Each dr As DataRow In drs
            dar("Profit") = dar("Profit")
        Next
    End If
Next