Results 1 to 3 of 3
  1. #1
    pvl55 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    9

    Return values from yesterday date

    Hi, I want to pull in date parameters (# of days left in QTR, etc.) from a table based on yesterday's date. Is this possible in a simple access query?
    Example: Latest invoice date is 8/24. Being its 8/24, query needs to pull days remining in QTR at that time.


    I have a full table to show date parameters.
    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,537
    The attached db has some date function which may be of use
    Attached Files Attached Files
    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
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Here's a function that will calculate days remaining in quarter from yesterday.

    Code:
    Public Function fcnDaysRemainingInQuarter() As Long
        Dim y As Long, m As Long, d As Long, qEndDate As Date
        y = Year(Date - 1)
        m = 3 * Int((Month(Date - 1) - 1) / 3) + 4
        d = 0
        qEndDate = DateSerial(y, m, d)
        fcnDaysRemainingInQuarter = DateDiff("d", Date - 1, qEndDate)
    End Function

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

Similar Threads

  1. Running Macro for yesterday's date
    By mjburne88 in forum Macros
    Replies: 3
    Last Post: 09-24-2015, 10:06 AM
  2. Use Cdate and write yesterday's date?
    By Elin in forum Programming
    Replies: 4
    Last Post: 09-18-2014, 03:30 AM
  3. Yesterday's Date ignoring weekends
    By coletteabrown in forum Access
    Replies: 4
    Last Post: 12-09-2013, 08:02 AM
  4. Replies: 6
    Last Post: 10-05-2012, 02:38 PM
  5. Replies: 5
    Last Post: 05-24-2012, 02:34 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