Dim ss As String = "08:00:00"
Dim ssz As String = "08:30:00"
Dim sx As String = "12:00:00"
Dim sxz As String = "11:30:00"
Dim xs As String = "13:00:00"
Dim xsz As String = "13:30:00"
Dim xx As String = "17:00:00"
Dim xxz As String = "16:30:00"
Dim dr As DataRow
For Each bh() As String In DataTables("人员").GetValues("编号|姓名","启用 = 1")
For Each dd() As String In DataTables("采集数据").GetValues("Y|M|D","编号 = '" & bh(0) & "'")
dr = DataTables("勤表").AddNew
dr("编号") = bh(0)
dr("姓名") = bh(1)
dr("Y") = dd(0)
dr("M") = dd(1)
dr("D") = dd(2)
Dim ts() As String = DataTables("采集数据").GetValues("T", "编号 = '" & bh(0) & "' and Y = '" & dd(0) & "' And M = '" & dd(1) & "' And D = '" & dd(2) & "'")
Dim ti As String = ""
Dim cd As Intege = 0
Dim zt As Intege = 0
Dim am As Intege = 0
Dim pm As Intege = 0
Dim all As Intege = 0
For Each t As String In ts
Dim st As String = t.SubString(t.Length - 8)
ti = ti & "|" & st
If st > ssz AndAlso st < ssz OrElse st > xs AndAlso st < xsz Then
cd += 1
ElseIf st > sxz AndAlso st < sx OrElse st > xxz AndAlso st < xx Then
zt+= 1
End If
If st < ss OrElse st > xxz Then
all+=1
End If
If st < ss OrElse st > sxz AndAlso st < xsz Then
am += 1
End If
If st > xxz OrElse st > sxz AndAlso st < xsz Then
pm += 1
End If
Next
If all >= 2 Then
dr("考勤") = 480
Else
If am >= 2 OrElse pm >= 2
dr("考勤") = 240
End If
End If
dk("迟到次") = cd
dk("早退次") = zt
dk("时间") = ti.Trim("|")
Next
Next