Results 1 to 4 of 4
  1. #1
    FactoryMan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    2

    Group by week with a specific starting time

    I have a manufacturing database that I need to group by weeks.
    I have been successful in grouping by weeks: PROD_TIME By Week: Format$([Copy of Query].[PROD_TIME],'ww',1,2)
    However my weeks start on Monday at 8:00 AM.
    How do I group by weeks with the week starting on Monday at 8:00 AM?


    Each record has a date/time field mm/dd/yyyy hh:mm:ss.

    I am pretty much a novice at this.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Did you try setting the FirstDayOfWeek argument to Monday?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    FactoryMan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    2
    Quote Originally Posted by June7 View Post
    Did you try setting the FirstDayOfWeek argument to Monday?
    Thanks for the question.
    Yes I did. I have no problem with my week groups starting on Monday the issue is how do I set the week to beging at 8:00 AM on Monday.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    That's a new one! Midnight to 7:59:59 each Monday morning should be in the previous week? Are there actually records within that time range?

    Try:

    Format$([Copy of Query].[PROD_TIME],'ww',1,2) - IIf(Weekday([datefield])=2 AND [PROD_TIME]<#8:00:00 AM#, 1, 0)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-11-2013, 10:14 AM
  2. Export Query to .ODS file starting at a specific cell
    By Baldeagle in forum Import/Export Data
    Replies: 4
    Last Post: 03-20-2013, 01:03 PM
  3. Replies: 0
    Last Post: 06-01-2012, 04:45 AM
  4. How to group by week
    By accessmatt in forum Reports
    Replies: 21
    Last Post: 09-28-2011, 09:40 AM
  5. Starting an Access database for a group...
    By kkrishna in forum Access
    Replies: 8
    Last Post: 05-19-2010, 05:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums