Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2008
    Location
    Daytona Beach, Florida, USA
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Show the Week to begin on Saturday instead of Sunday

    I have a database with a table call Hours Worked and a Macro called Update Week # that automatically inputs the week # when a date is entered. Currently the week is starting on a Sunday and ending on a Saturday, I would have to make it so the week starts on Saturday and ends on Friday.

    In the Table the format is 'ww'

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    How is it automatically inputing the week#? What function is used by the Macro?
    Regards
    John



  3. #3
    Lounger
    Join Date
    Aug 2008
    Location
    Daytona Beach, Florida, USA
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok, finally figured out how this is working. In the table, there is a Field Name [Week #], with a format of 'ww'. The "Update Week #" Macro is Set Value to Item [Week #], Expression [Date_Worked]. So in the Form that I input everything into, when I input the Date it runs the Macro "Update Week #"

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    So you acatually two fields that both contain the same value, the date, but the second is formatted as ww so it is just shown as a number.

    You don't actually need a field in a table for Week# as you can calculate it any time you want it using the DatePart function.
    You can read about DatePart here.

    DatePart("ww",#8/8/2011#)=33
    By default DatePart regards Sunday as the first day of the week, you can add extra parameters to say what you want the first day of the week, and first day of the year to be.

    DatePart("ww",#8/8/2011#,4)=32 because it treats Wednesday as the first day of the week.
    Regards
    John



  5. The Following User Says Thank You to johnhutchison For This Useful Post:

    brandy9271 (2011-08-26)

  6. #5
    Lounger
    Join Date
    Aug 2008
    Location
    Daytona Beach, Florida, USA
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you John!!!

Posting Permissions

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