窗口加入两个DateTimePicker,用于输入起始日期和结束日期,再加入一个按钮,按钮代码为:
Dim dt1 As Date = e.Form.Controls("DateTimePicker1").Value
Dim dt2 As Date = e.Form.Controls("DateTimePicker2").value
Dim flt As String = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
Dim nms As List(of String) = DataTables("员工日积分").GetUniqueValues(flt,"姓名")
DataTables("员工月积分统计").DataRows.Clear()
For Each nm As String In nms
Dim s As String = ""
For Each dr As DataRow In DataTables("员工日积分").Select("姓名 = '" & nm & "' And " & flt)
If s > "" Then
s = s & chr(13) & chr(10)
End If
s = s & dr("其他工作说明")
Next
Dim dr2 As DataRow = DataTables("员工月积分统计").AddNew
dr2("姓名") = nm
dr2("月其他工作说明") = s.Trim()
Next