3 Replies Latest reply: Apr 6, 2017 3:04 PM by Mike Hildner RSS

    Interesting Week() Behaviour

    Mike Hildner

      I'm seeing some strange results when using the Week() function when FirstWeekDay=0. When FirstWeekDay=6, things appear normal, but changing it to 0 produces something I don't understand.

       

      E.g. if I use this as an expression (when FirstWeekDay=0):

       

      Week(Date#('12/31/2016', 'M/D/YYYY'))

      & '|' &

      Week(Date#('1/1/2017', 'M/D/YYYY'))

      & '|' &

      Week(Date#('1/2/2017', 'M/D/YYYY'))

       

      The result is:

       

      53 | 1 | 2

       

      I understand that there were 53 ISO weeks last year, but how could Jan. 1st of this year be week 1, and Jan. 2 be week 2? Shouldn't Jan 1st still be in week 53 and Jan 2nd be in week 1?