Results 1 to 2 of 2
  1. #1
    oliver.marshall001 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    1

    Select Records with Date 30 days prior to the last day of previous month

    For the mothly report that I have to produce I need to organize the data from an automated report that is generated at the end of each month.



    I'd like to write a query that can select records from this automated report that are dated 30 days or less from the last day of the prior month. For example, if I were compiling my report today, 9/5/14, then I'd want all records dated between 8/31/14 and 8/1/14. The date field in this report is called "TransTime."

    I'm fairly inexperienced with access and have little exposure to SQL so any help with this would be greatly appreciated.

    Thanks in advance.

  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,521
    Try this in the query criteria on the date field:

    Between DateSerial(Year(Date()), Month(Date()) - 1, 1) And DateSerial(Year(Date()), Month(Date()), 0)
    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. Replies: 21
    Last Post: 06-27-2014, 07:33 AM
  2. Replies: 2
    Last Post: 04-15-2014, 08:43 AM
  3. Select Month from previous selected year
    By k0enf0rNL in forum Access
    Replies: 1
    Last Post: 01-15-2014, 12:14 PM
  4. Replies: 1
    Last Post: 02-12-2013, 03:48 AM
  5. Replies: 3
    Last Post: 06-19-2012, 10:42 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