Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Non Standard Week (2003 ALL SPs)

    I have a time sheet type database which needs to calculate hours, especially overtime. At present it does this by summing the "Normal" hours for a particular week and if they exceed a set quantity, calculating how many are at overtime rates. eg if the hours for a week are 48 then this exceeds the normal 40 hour week by 8 which would be classified as overtime.
    My issue is that the pay period is fortnightly so I need to split this into weeks to determine the overtime for a particular week. All working OK based on grouping by week number. However the pay weeks starts on a Thursday, not a Sunday - Any suggestions as to how to handle this
    TIA
    Steve
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Non Standard Week (2003 ALL SPs)

    Think I got it - subtract 4 days from date used to determine week no
    DateWorked By Week: Format$(HoursWorked.DateWorked-4,'ww')
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Non Standard Week (2003 ALL SPs)

    Another things to try is using the DatePart function.

    weekNumber : DatePart("ww",[StartDate]) will tell you the weeknumber of the field start date, using the default first day of week (sunday).

    weekNumber : DatePart("ww",[StartDate],5) specifies that you want to treat thursday as the first day of the week. In this case I have added the optional firstweekday parameter.
    Regards
    John



  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Non Standard Week (2003 ALL SPs)

    Similar to John's suggestion, the Weekday function also has an optional FirstDayOfWeek argument:

    Weekday(HoursWorked.DateWorked) will return 1 = Sunday, 2 = Monday, etc.
    Weekday(HoursWorked.DateWorked,5) will return 1 = Thursday, 2 = Friday, etc.

Posting Permissions

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