Results 1 to 2 of 2
  1. #1
    flamingphoenix is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    1

    DSum with Multiple Critera in a Query

    Hello,



    I'm a novice to Access and using Access 2010.

    I'm trying to create a DSum formula in a query that sums the positive values in [AllocationRemaining] (and ignores the negative values] for each ProductID.

    ProductID = number
    AllocationRemaining = number
    Both fields are stored in a query called RemainingAllocation

    I've tried various different amendments but I can't work out the correct way to phrase the ProductID part of my criteria. My latest attempt was:

    DSum("[AllocationRemaining]","RemainingAllocation","[AllocationRemaining]>0 ' " & [ProductID] & " ' ")

    I know the first three parts work as if I remove the ProductID criteria, it will sum the positive values in the entire sheet. However I'm really struggling with the how to express that criteria (probably because I'm just adapting other formulas that I've seen in other threads)

    Any help would be greatly appreciated!!

    Thanks
    Liz

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    make a calculated field in your query
    pAR: iif([AllocationRemaining]>0,[AllocationRemaining],0)

    then sum the pAR field

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

Similar Threads

  1. Value from DSUM with multiple criteria wrong
    By maxmaggot in forum Reports
    Replies: 4
    Last Post: 04-12-2014, 05:21 PM
  2. Query Critera w/ two Paths
    By Mike4172 in forum Queries
    Replies: 6
    Last Post: 04-10-2013, 08:47 PM
  3. Replies: 7
    Last Post: 03-17-2013, 07:12 AM
  4. multiple seach critera
    By dirtbiker1824 in forum Queries
    Replies: 1
    Last Post: 03-29-2011, 01:17 PM
  5. Query that would search multiple critera and delete
    By justinwright in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 10:05 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