感谢感谢!!!Dim names As List (Of String) =
DataTables("检查登记表").GetUniqueValues("随访地区 Is Not
Null","随访地区")
For Each name As String In names
For Each r As Row In Tables("统计表").Rows
If r("乡镇名称") = name Then
r("孕检人数") =
DataTables("检查登记表").Compute("Count(检查类别)","随访地区 =
'" & name & "' And 检查类别 Like '*" & "孕*'")
End If
Next
Next
For Each r As Row In
Tables("检查登记表").Rows
For Each rw As Row In Tables("已录入名单").Rows
If r("妻子证件号码") = rw("妻子证件号码")
AndAlso Left(r("检查日期"),4) = Left(rw("建档日期"),4) Then
r("档案编号") = rw("档案编号")
End If
Next
Next
上面的 If r("妻子证件号码") = rw("妻子证件号码") AndAlso Left(r("检查日期"),4) = Left(rw("建档日期"),4) Then这个条件我确实想改成建档日期在检查日期后365天内,因为假如在某一天的最后一天检查,而在新的一年头一天录入,原来的代码就查不到了。您看改成:If r("妻子证件号码") = rw("妻子证件号码") AndAlso r("检查日期") <= rw("建档日期")Then应该就行了(这样也避免了将以前将以前曾经检查过的人原来的档案号导入的问题)