1 Reply Latest reply on Jan 17, 2009 12:37 PM by George_Johnson

    How to find first day of the year

      Big picture: trying to determine how many pay periods are left in the year. There are 52 weeks in a year, and our company pay out each week.

      The first pay week of the year always starts on a Friday. So If Janurary 1 is a friday, then the 1st week of pay period starts that week. If Jan 1 is a Thursday, then the first pay week will start on Janurary 2.

      I need to figure out what day the first day of any year it is. By day, i mean Mon, Tue, Wed, Thur, Fri, Sat, or Sun.

      Then when I figure out what day it is, i will write an if/then statement saying if Jan 1 is a monday, then add 4 days to that date and that will be the first day of a pay period.

      Then when i figure out the first day of the first week, I wanted to add 7 days to create week2, week3.... week 52.

      Then take todays date and if it was between week x and week y, then it would determine that z many pay periods are left...

      is this the best way to go about this? anything easier?