我试图找出可空日期之间的区别。DateDiff(DateInterval.Day, firstDate, secondDate)
适用于Date
,但不适用于Nullable(Of Date)
。我的两个日期都是可为空的字段。
这是错误消息:
重载解析失败,因为没有
DateDiff
缩小转换就无法调用可访问:
Public Function DateDiff(Interval As String, Date1 As Object, Date2 As Object, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As Long
: 参数匹配参数Interval
从 缩小Microsoft.VisualBasic.DateInterval
到String
。
Public Function DateDiff(Interval As Microsoft.VisualBasic.DateInterval, Date1 As Date, Date2 As Date, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As Long
: 参数匹配参数Date1
从 缩小Date?
到Date
。
Public Function DateDiff(Interval As Microsoft.VisualBasic.DateInterval, Date1 As Date, Date2 As Date, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As Long
: 参数匹配参数Date2
从 缩小Date?
到Date
。