Results 1 to 5 of 5
  1. #1
    mindbender is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    275

    Quater to date and Year to date query up to end of previous month

    What I am trying to do is create a quarter to date and year to date queries only up to the end of the previous month



    So if the query was run in May
    Previous quarter would only include April and YTD would only include Jan-Apr

    if the query was run in June
    Previous quarter would only include April and May and YTD would only include Jan-May

    I am having zero luck figuring this out

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The date field's criteria would be <CDate(format(Date(),"mm") & "/01/" & Format(Date(),"yyyy"))

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure if you are doing only this year or grouping by year? If only this year:

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure if you are doing only this year or grouping by year? If only this year:
    Between CDate("01/01/" & Format(Date(),"yyyy")) And CDate(format(Date(),"mm") & "/01/" & Format(Date(),"yyyy")-1)

  5. #5
    mindbender is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    275
    I think I got it using the following for quarter to date up to the end of previous month

    Field - Year[DATEFIELD] Criteria - Year(Now())
    Field - DatePart("q",[DATEFIELD]) Criteria - DatePart("q",Now())
    Field - Month[DATEFIELD] Criteria - <Month(Now())

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

Similar Threads

  1. Get month and year from date
    By shayen in forum Programming
    Replies: 3
    Last Post: 09-21-2016, 03:04 AM
  2. Count by Date, Month and Year in one Query
    By Medee in forum Queries
    Replies: 1
    Last Post: 06-25-2016, 03:48 AM
  3. Replies: 5
    Last Post: 08-14-2015, 02:53 PM
  4. Replies: 5
    Last Post: 08-26-2014, 06:07 AM
  5. Replies: 4
    Last Post: 05-26-2013, 03:28 PM

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 - Senior Forums