Dim Day As Date = #21:00#
Dim Day1 As Date = #23:00#
Dim tp As TimeSpan
tp = day - day1
Output.Show(Format(day1,"HH:mm:ss"))
Output.Show(tp.TotalSeconds)
Dim dtkqsj1 As DataTable = Functions.Execute("生成cmd数据表","小程序考勤","")
Dim ckd123 As DataRow
ckd123 = dtkqsj1.SQLFind("记事人 = '杜义' And 上传时间 = '2024-03-31' And cast(记事时间 as time) >= '" & Format(day,"HH:mm") & "' And cast(记事时间 as time) <= '" & Format(day1,"HH:mm") & "'")
If ckd123 IsNot Nothing Then
Output.Show(ckd123("上传时间"))
Output.Show(ckd123("记事时间"))
Output.Show(Format(ckd123("记事时间"),"HH:mm:ss"))
Else
Output.Show(Format(ckd123("记事时间"),"HH:mm:ss"))
End If
记事时间 ,在 day 和 day1 之间的时候 可以正确查找 记事时间超出范围以后,报错
此主题相关图片如下:1714186073381.jpg