Results 1 to 2 of 2

Thread: DateDiff function......

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    Singapore
    Posts
    24

    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??

  2. #2
    pvb
    Guest
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width