我写了一个流程语句,不知道理解的对不对?
Dim dt As DataTable = DataTables("考勤")
For Each dr As DataRow In dt.DataRows
Dim d1 as Date = dr("日期")
if d1.dayofweek = 0 Then
d1 = d1.AddDays(-d1.dayofweek-6)
Dim d2 as Date = d1.AddDays(-d1.dayofweek+7)
Dim Sum As Integer = dt.Compute("Sum(请假工时)","姓名 = '" & dr("姓名") & "' And 日期 >= #" & d1 & "# And 日期 <= #" & d2 & "#")
if Sum < 8 Then
dr("带薪工时判断条件_星期几为0_带薪工时值") = 8
Else
dr("带薪工时判断条件_星期几为0_带薪工时值") = Nothing
End If
End If
Next