比如代码
Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
Dim cs As String = "月份,工号"
Dim t As Table = Tables("员工收入合计2018")
For Each dr As DataRow In t.DataTable.Select("", cs)
Dim flag As Boolean = False
If pdr IsNot Nothing Then
For Each c As String In cs.split(",")
If pdr(c) <> dr(c) Then
flag = True
Exit For
End If
Next
End If
If flag Then
If count > 1 Then
idx &= idx_temp
End If
count = 1
idx_temp = ""
idx_temp &= dr("_Identify") & ","
Else
count += 1
idx_temp &= dr("_Identify") & ","
End If
pdr = dr
Next
If count > 1 Then
idx &= idx_temp
End If
t.filter = "_Identify in (" & idx.trim(",") & ")"
如果得到冗余值,参考 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=114307&skin=0
[此贴子已经被作者于2018/2/28 15:37:13编辑过]