Results 1 to 4 of 4
  1. #1
    Andy42k is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    2

    Comparing 2 set of dates.

    I have a DB where I want to compare 2 set of dates. For example how many items were sold this year for a specific 28 day, monthly and yearly period vs the same last year. I can run the query 3 times, once for each of the specific date ranges, but I want to be able to compare those dates ranges. i.e 1/1/2016 to 1/29/16 vs 1/1/15 to 1/1/15.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    look at using the dateadd function to subtract 1 year from your current year dates.

    not enough information to suggest how to apply this, might be a groupby query with or without crosstab, might require a subquery, might be a union query

  3. #3
    Andy42k is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    2
    What more enough would you need to suggest something a little more concrete?

    Quote Originally Posted by Ajax View Post
    look at using the dateadd function to subtract 1 year from your current year dates.

    not enough information to suggest how to apply this, might be a groupby query with or without crosstab, might require a subquery, might be a union query

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    1. what is your table structure (relevant to this requirement)
    2. provide examples of the current data
    3. provide example of what the required output is from this data
    4. provide the sql for what you are running 3 times
    5. what are you comparing - for a single item or all items? for one kpi (you mention quantity) or many? quantity/value/cost
    6. how are you comparing? on a form or a report? export to excel? for use in a graph?
    7. are you calculating the difference in the query
    8. does the data need to be updateable
    9. clarify what you mean by 'I can run the query 3 times, once for each of the specific date ranges,' AND 'but I want to be able to compare those dates ranges. i.e 1/1/2016 to 1/29/16 vs 1/1/15 to 1/1/15.' a) there are only two dates and b) one is for a 29 day period and the other 1 day.

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

Similar Threads

  1. Subquery Help! Comparing Dates between rows
    By JayRab in forum Queries
    Replies: 2
    Last Post: 02-20-2014, 10:10 AM
  2. Comparing dates
    By scoe in forum Queries
    Replies: 8
    Last Post: 11-27-2013, 02:04 AM
  3. Access-comparing Dates
    By espinosaja in forum Access
    Replies: 7
    Last Post: 12-03-2011, 01:14 AM
  4. Comparing dates
    By shanky365 in forum Queries
    Replies: 2
    Last Post: 10-26-2011, 01:28 AM
  5. Comparing Part Quantities According to Dates
    By rochy81 in forum Reports
    Replies: 6
    Last Post: 05-19-2009, 09:11 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