Results 1 to 4 of 4
  1. #1
    mjburne88 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    2

    Running Macro for yesterday's date

    the following is my current Macro in Access 2013. Currently, when I run it, I still have to enter yesterday's date (or last weekday) manually. What would I enter in place of the actual date in the Macro in order to have it automatically run with yesterday's date? Thanks

    SELECT [SOM (2)].[Group Date], Sum([SOM (2)].Amount) AS SumOfAmount
    FROM [SOM (2)]


    GROUP BY [SOM (2)].[Group Date]
    HAVING ((([SOM (2)].[Group Date])=#9/23/2015#));

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That's a query, not a macro. Yesterday's date:

    HAVING [SOM (2)].[Group Date]=Date()-1
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mjburne88 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    2
    Thanks, I will try that. sorry for the confusion.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No worries, I was just clarifying for you. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Use Cdate and write yesterday's date?
    By Elin in forum Programming
    Replies: 4
    Last Post: 09-18-2014, 03:30 AM
  2. Yesterday's Date ignoring weekends
    By coletteabrown in forum Access
    Replies: 4
    Last Post: 12-09-2013, 08:02 AM
  3. Replies: 6
    Last Post: 10-05-2012, 02:38 PM
  4. Replies: 5
    Last Post: 05-24-2012, 02:34 PM
  5. running macro in another DB
    By AdrianoG87 in forum Import/Export Data
    Replies: 1
    Last Post: 09-30-2011, 12:31 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