3 Replies Latest reply on Jan 31, 2017 8:37 AM by philmodjunk

    Two Week Pay Period Calculation Flipped in 2017

    user28271

      Hi all....

       

      I have a client that has a two week pay period.  I wrote a calculation to set the period and it has worked perfectly for the last 6 years.  Until now.

       

      Starting in 2017 is period has flipped. It was a simple thing to adjust,  but I am confused as to why this happened.  So I am looking for opinions.

       

      What is my calculation you ask?

      I have a system Preference table with two date fields: Week 1 and Week 2.  Admin enters a sample dates for week 1 and week 2.

       

      System calculates whether the weeks are Odd or Even and then use that from then on.

       

      Mod ( WeekOfYear ( Week1 ) ; 2 )

       

      Fo the last six years week one was Even and week two was Odd.  Now they have flipped.

       

      Comments welcome (including a better way to do this)

        • 1. Re: Two Week Pay Period Calculation Flipped in 2017
          philmodjunk

          Take a look at the Calendar for 2017. January 1st falls on a Sunday, so for the first time in a number of years, there is no "partial week that starts in the previous year and ends in the first part of January. Thus, a January date in the days 1 thru 7 range will have a week of year value of 1 and be odd.

           

          I can't provide a work around to fix this as I don't know how you are using the fact that the first week of the year might be odd or even in your calculations.

          1 of 1 people found this helpful
          • 2. Re: Two Week Pay Period Calculation Flipped in 2017
            user28271

            Thanks.  Mostly I wanted to know WHY which you have brilliantly answered.

             

            As to what I do with my odd and even....

             

            Once the system know week 1 is even and week two is odd I can have a field on the Time Card print out that say Week 1 or Week 2.  That is all I am doing with it.

             

            Sadly now that this has changed if they go back to previous years to re-print a report it will be wrong.

             

            So I guess I will have to POST that information to a text field (and fill the last 6 years of time cards).

            • 3. Re: Two Week Pay Period Calculation Flipped in 2017
              philmodjunk

              Going forward, You can simply record whether the first week is odd or even in a global field or variable each time the file opens or use a relationship to link to a record that records this detail. Then compare whether the current week is odd or even to whether the first week is odd or even in order to show either Week 1 or Week 2....