Dim t As DataTable = DataTables("核算项目科目组合表")
For Each dr As DataRow In t.DataRows
Dim Val1 As Date = dr("应收账款更新日期")
Dim Val2 As Date = dr("应交税费更新日期")
Dim Val3 As Date = dr("内部往来更新日期")
Dim Val4 As Date = dr("工程施工更新日期")
Dim Val5 As Date = dr("损益更新日期")
Dim Val6 As Date = dr("应付账款更新日期")
Dim cmd As New SQLCommand
Dim dts As Date
cmd.C
cmd.CommandText = "Select GetDate()"
dts = cmd.ExecuteScalar()
If dts In (Val1, Val2, Val3, Val4, Val5, Val6) Then
dr("更新记录_更新日期") = dts
dr("变动状态") = "变动"
Else
dr("变动状态") = Nothing
End If
Next
老师上面代码是在一行中我多个日期列,如果其中至少有一列日期是今天,那么执行,否则变动状态列为空值。出错了,应该怎么写?
谢谢老师!
[此贴子已经被作者于2023/9/19 15:47:10编辑过]