Results 1 to 5 of 5
  1. #1
    coletteabrown is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7

    Yesterday's Date ignoring weekends

    Hello -

    I'm using the Date()-1 to populate a form with yesterday's date for easier data entry. However, on Mondays I always have to change the date to Friday's date because it is populating yesterday's date (which in this case is Sunday). Is there an access expression that calculate yesterday's date but ignores weekends? So that on Monday yesterday would mean Friday?

    Thanks!


    Colette

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,545
    Try:
    =IIf(Weekday(Date()-1)=1,Date()-3,Date()-1)
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    coletteabrown is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    That worked! Thanks

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,545
    Quote Originally Posted by coletteabrown View Post
    That worked! Thanks
    I never doubted that it would , but it would need some modification to handle entries made on a Sunday as well.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    coletteabrown is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    Haha!

    Not to worry, I'll stick to running Friday's reports on Monday. Thanks

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

Similar Threads

  1. Replies: 1
    Last Post: 08-13-2013, 09:39 AM
  2. Replies: 8
    Last Post: 10-20-2012, 11:25 AM
  3. Replies: 6
    Last Post: 10-05-2012, 02:38 PM
  4. Replies: 5
    Last Post: 05-24-2012, 02:34 PM
  5. Adding 5 days to date function but exclude weekends
    By mulefeathers in forum Queries
    Replies: 1
    Last Post: 04-27-2012, 10:28 AM

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