For the first one, 53 is correct.  I'm guessing that you found a bug on the
second one.  Since that "week" doesn't start on a Sunday, it could be
"assuming" 52 since it it part of the last week of the previous year.
However, a value of 53 for the first one is also including a partial week of
'08, which started on a Tuesday.

...Glenn

On Thu, Nov 13, 2008 at 11:49 AM, Duckster101 <
[EMAIL PROTECTED]> wrote:

>
> I am trying to use the DatePart function to return the week number for
> a specific date.  I have been having difficulty getting it to return
> the correct week number.
>
> When I use the DatePart function using all the same parameters except
> the date, the function returns different results.
>
> For example:
>
> DatePart(DateInterval.WeekOfYear, CType("12/29/08", Date),
>             FirstDayOfWeek.Monday, FirstWeekOfYear.FirstFourDays)
> Returns 53
>
> DatePart(DateInterval.WeekOfYear, CType("1/3/09", Date),
>              FirstDayOfWeek.Monday, FirstWeekOfYear.FirstFourDays)
> Returns 52
>
> As you can see, the only thing different between these two functions
> is the date that is passed.  Both of these dates fall within the same
> week, so why the difference in what it returns?
>

Reply via email to