Results 1 to 4 of 4
  1. #1
    pmatush is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    11

    Different filters for same field in one query

    So I have a query that gives me the total spent on different projects. We're now interested in how the costs come in over time. I can set a filter on the date field so I see all costs since the beginning of 2012, for example. However, I would like the query to return different ranges in different fields. ie., one field has costs for last six months, another shows costs for the last year, and another over the last two years, instead of running the query 3 different time with different ranges on the dates.



    Thanks,
    Patrick

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847

  3. #3
    pmatush is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    11
    That's not quite what I need. I'm not looking to necessarily break up the data into specific range lengths. The past year includes the past six months, for example. There has to be a way to have multiple cost summation columns, with different date ranges on each.

    Thanks though

  4. #4
    pmatush is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    11
    Self answer:

    Set totaling type to expression.
    In field 1: Last year: Sum(IIf([Date]>#2/1/2012#,[costs],0))
    In field 2: Last two years: Sum(IIf([Date]>#2/1/2011#,[costs],0))

    Hope this helps someone else...

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

Similar Threads

  1. A running sum and filters
    By Marin in forum Reports
    Replies: 4
    Last Post: 07-28-2013, 02:00 PM
  2. Query filters slower, if left open
    By Frenotx in forum Queries
    Replies: 5
    Last Post: 01-25-2012, 03:25 PM
  3. Help with filters
    By daltman1967 in forum Forms
    Replies: 5
    Last Post: 07-14-2011, 02:12 PM
  4. Query Filters
    By ellixer in forum Queries
    Replies: 2
    Last Post: 06-27-2011, 08:26 AM
  5. About filters
    By registan in forum Forms
    Replies: 12
    Last Post: 04-09-2011, 08:01 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