Dim ids As String
Dim n As Integer = 30 '未来天数,含今天,所以实际是未来30天
For Each dr As DataRow In DataTables("dk_lxb").DataRows
Dim dt As Date = dr("fxrq") '应付日期
Dim dt1 As Date =Date.Today() '今天当天日期
Dim dt2 As New Date(Date.Today.AddDays(n).Year,dt.Month,dt.Day) '今天 加30天后日期
If (dt >= dt1 AndAlso dt < Date.Today.AddDays(n)) Then
ids = ids & "," & dr("_Identify")
End If
Next
If ids > "" Then
ids = ids.Trim(",")
Tables("30天内应付利息应还本金_Table1").filter = "[_Identify] In (" & ids &")"
Tables("30天内应付利息应还本金_Table1").Sort = "fxrq"
End If
运行出现:Year, Month, and Day parameters describe an un-representable DateTime. 以前一直没问题,今天出现,是什么问题?谢谢