Results 1 to 3 of 3
  1. #1
    Toble is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    11

    Question Criteria to specify date period

    Hi

    What is the criteria to extract data for the last 12 months starting from the previous month?



    Example :
    User runs report today (9th July 2015)
    Report should only reflect data from June 2014 to June 2015 (i.e. last 12 months data starting from the previous month)

    Similarly, user runs report in August 2015.
    Report should only reflect data from July 2014 to July 2015

    My current criteria, which to extract data for the last 12 months starting from the current month, is

    >=DateAdd("m",-12,Date())

    Much appreciated

  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
    That's actually 13 months.

    you can subtract 12 months from the first of this month for the start date. A sneaky way to get the last day of the previous month is day 0 of this month, using DateSerial.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Toble is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    11
    Quote Originally Posted by pbaldy View Post
    That's actually 13 months.

    you can subtract 12 months from the first of this month for the start date. A sneaky way to get the last day of the previous month is day 0 of this month, using DateSerial.

    would you be able to provide the syntax if it's not too much trouble?

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

Similar Threads

  1. Date Range Query for Valid Period
    By Ari C in forum Queries
    Replies: 4
    Last Post: 11-18-2014, 01:47 PM
  2. To find Month and Days in given date period
    By waqas in forum Programming
    Replies: 1
    Last Post: 02-12-2013, 02:50 PM
  3. Replies: 18
    Last Post: 02-06-2013, 12:43 PM
  4. Alert on Existing Date Period
    By waqas in forum Access
    Replies: 5
    Last Post: 02-03-2013, 10:38 PM
  5. Getting Tax Period from current date
    By crxftw in forum Forms
    Replies: 3
    Last Post: 07-09-2011, 07:12 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