Case "上午上班","下午下班"
If dr.IsNull("上午上班") Or dr.IsNull("下午下班") Then
dr("出勤时数") = Nothing
Else
Dim tp As TimeSpan
dim d1 as date = dr("上午上班")
if format(d1,"HH:mm") < "08:00" then d1 = cdate(format(d1,"yyyy-MM-dd 08:00"))
dim d2 as date = dr("下午下班"")
if format(d2,"HH:mm") > "17:00" then d2 = cdate(format(d2,"yyyy-MM-dd 17:00"))
tp = d2 - d1
dr("出勤时数") = tp.TotalHours() '真正的时段型数据要转换为秒数,才能存入时段列
End If
[此贴子已经被作者于2019/7/23 9:04:00编辑过]