WeekNumber (iso-8601) correction

Results 1 to 2 of 2

Thread: WeekNumber (iso-8601) correction

  1. #1
    Join Date
    Dec 1969

    Default WeekNumber (iso-8601) correction

    DJ!<BR>I think that there is a misstake in the function you made. Reproduce by checking with 12/31/1999 and 1/1/2000.<BR><BR>I updated the function to read as below, do you think that is correct?<BR><BR>Also, do you have any suggestions for the reverse, i.e. making a date out of WeekDay + WeekNumber + Year?<BR><BR>-------------UPDATED GetISOWeekDay -------------<BR>sub GetISOWeekDay(dtDate, intWeek, intDay, intYear) <BR><BR> dim intYY<BR> dim intA <BR><BR> intYY = Year(dtDate) <BR><BR> intWeek = datediff("ww", cdate("1/1/" & intYY), dtDate, vbMonday, vbFirstFourDays) <BR> intDay = weekday(dtDate, vbMonday)<BR> <BR> if intWeek = 0 then<BR> If intDay &#062; 4 Then<BR> intWeek = 52 <BR> Else<BR> intWeek = 53 <BR> End If<BR> intYear = intYY - 1 <BR> else <BR> intYear = intYY <BR> end if <BR>end sub <BR>-------------UPDATED GetISOWeekDay -------------<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: WeekNumber (iso-8601) correction

    It sounds good, and I think that&#039s what Bill was trying to point out.

Posting Permissions

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