Dim ndt As new DataTableBuilder("临时")
ndt.AddDef(“日期",Gettype(Date))
Dim ls As new List(Of String)
For Each dr As DataRow In DataTables("出差登记").datarows
For Each s As String In (dr("姓名") & "," & dr("同行人员")).split(",")
If s > "" AndAlso ls.Contains(s) = False Then
ls.add(s)
ndt.AddDef(s, Gettype(String))
End If
Next
Next
ndt.Build
For Each dr As DataRow In DataTables("表A").datarows
Dim fdr As DataRow = DataTables("临时").find("时间 = #" & dr("时间") & "#")
If fdr Is Nothing Then
fdr = DataTables("临时").AddNew
fdr("时间") = dr("时间")
End If
For Each s As String In (dr("姓名") & "," & dr("同行人员")).split(",")
If s > "" AndAlso ls.Contains(s) Then
fdr(s) = dr("地点")
End If
Next
Next