Results 1 to 2 of 2
  1. #1
    Flafel is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2022
    Posts
    3

    identifying a floating date for the current year

    Hi there, and thanks in advance for considering this question.

    I need to identify the date for the Saturday closest to Sept. 24 for the current year. For example last year, it was Sept. 25, this year, it would be Sept. 24, and for 2023 it would be Sept. 23, etc. Not 100% how to start this logical conundrum.



    Thanks...

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Something like this would work (in a query I added a hard-coded field: SelectedDate: #9/24/2027# that I could change the year to test):

    Expr1: IIf(Weekday([SelectedDate]) In (1,2,3),[SelectedDate]-Weekday([SelectedDate]),[SelectedDate]+(7-Weekday([SelectedDate])))
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 5
    Last Post: 06-10-2021, 09:04 AM
  2. Replies: 3
    Last Post: 02-16-2016, 05:02 PM
  3. Current Year Date Filter
    By barkly in forum Queries
    Replies: 5
    Last Post: 08-24-2013, 03:50 AM
  4. Current Month and Year-To-Date
    By DSnipeFunk in forum Access
    Replies: 4
    Last Post: 05-31-2011, 11:38 AM
  5. Changing a date to the current year
    By fdnyfish in forum Access
    Replies: 1
    Last Post: 03-01-2008, 08:34 AM

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