Results 1 to 8 of 8
  1. #1
    MrJukas is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    13

    Sumifs for access

    Hello guys,
    I wonder how to do a sumifs on access.

    I noticed dsum() could be a good solution. Do you agree? Any other suggestions?

    What I need to do is this:
    I have a list of items, quantities and dates. I want to add a field that calculates at every row the sum of the quantities for the same items, with the dates older than the one showed.

    Any suggestions is welcome. Thanks

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Sounds like Dsum is what you need.

  3. #3
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Quote Originally Posted by Perceptus View Post
    Sounds like Dsum is what you need.
    The only caution is that DSUM can be very slow in some situations. If it becomes a problem, you'll want to look into using queries that use an approach of:

    OutputFieldName: SUM(IIF(X=Y,[SourceField],0))

  4. #4
    MrJukas is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    13
    What about calculating time?

    I tried to run it, but in takes for ages!
    I have 20'000 lines initially, but because I have some criterias it goes down to 7000.
    I might have to break it down in two queries and then doing the dsum on the second query.

    Any comment? Dsum on 20000 lines, does it take a lot of time?

  5. #5
    MrJukas is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    13
    Thank you InsureancrGuy,
    Would you mind be more specific on your formulas?
    Sum(iif([item]=[item] and [Dates]>[dates ], [quantity ],0))
    I am not sure it will work. Does this formula look at every line and sum the quantities with the same items and dates older than the reference date?

  6. #6
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I performed a Dsum on 32000 Records using a linked table across a network. Took about 3 seconds.

  7. #7
    MrJukas is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    13
    Ok, weird. It took me a lot of time.

  8. #8
    MrJukas is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    13
    Hi, dsum() works. But as soon as I add a criteria it slows down.
    I broke the query down and it works faster.

    Thanks

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

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