-
DateDiff function......
Hi all,
I've tried the dateDiff function but i encountered some problem.
By right it should be:
diff = DateDiff(DateInterval.Day, dfText, startDate, FirstDayOfWeek.Sunday, FirstWeekOfYear.System)
But it prompt mi tat FirstDayOfWeek is ambiguous.
I also tried:
diff = DateDiff(DateInterval.Day, dfText, startDate)
but it prompt mi that no accessible overloaded dateDiff can be called w/o a narrowing conversion.
Does anybody have any idea whats wrong??
-
Not sure what that param dfText is but the following worked fine:
Code:
Dim myDateDiff As Long
Dim myDate1 As New Date(2001, 12, 25)
Dim myDate2 As New Date(2002, 12, 25)
myDateDiff = DateDiff(DateInterval.Day, myDate1, myDate2)
MessageBox.Show(myDateDiff.ToString)