Results 1 to 2 of 2
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185

    Convert dates to Friday

    Good afternoon. I can not find a solution. I used to know how to do this, but am drawing a blank.
    Hopefully this is a simple solution. I want to take a specified date and convert it to the Friday of that week. The week starts on Monday and goes through Sunday.
    Our weeks are Mon through Sun. If the date falls after Friday, and is Sat or Sun, it needs to refer back 1 or 2 days to Friday.



    So, any date from Monday, September 21 - Sunday, September 27, I need it to display as September 25th. and so on for each week of the year.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Calculating a date for week of a given date is common topic. Usually the desired day is Sunday or Monday. Try:

    DateAdd("d", 5 - Weekday([fieldname], vbMonday), [fieldname])

    Review https://vbaf1.com/date-time/current-monday-date/
    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: 11-02-2016, 07:28 AM
  2. Convert dates to more conventional format
    By didiomm in forum Queries
    Replies: 8
    Last Post: 06-22-2016, 12:50 PM
  3. How to Convert Dates Over To Months
    By djclinton15 in forum Queries
    Replies: 2
    Last Post: 11-08-2015, 07:34 PM
  4. Replies: 5
    Last Post: 04-09-2015, 12:55 AM
  5. Calculate last 4 weeks (Friday to Friday)
    By Astron2012 in forum Queries
    Replies: 2
    Last Post: 11-29-2013, 04:08 PM

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