1、加上条件就行,如 t.filter = "案件编号_2 > 案件编号_1"
2、或者改成
Dim idxs As String = "-1,"
Dim t As Table = e.form.controls("Table1").Table
For Each bh As String In t.DataTable.getvalues("加密字符")
Dim o As Integer = t.Compute("count(加密字符)", "加密字符 = '" & bh & "' and 登记状态 = '借出'")
Dim i As Integer = t.Compute("count(加密字符)", "加密字符 = '" & bh & "' and 登记状态 = '归还'")
If o >= i Then
idxs &= t.DataTable.Find("加密字符 = '" & bh & "' and 登记状态 = '借出'", "_Identify desc")("_Identify") & ","
End If
Next
t.filter = "_Identify in (" & idxs.trim(",") & ")"