Results 1 to 4 of 4
  1. #1
    zippy483 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    26

    Consolidating records by 2 different fields


    Good Afternoon all

    I'd like a little help if you will

    I have an access database that in part is used for stock accounting for a stores/parts system.

    I can build a query to export the raw data that isn't a huge problem the datasheet looks something like this (simplified)

    ProductTable
    PartNumber Site ItemIn ItemsOut Adjustment
    12345 Site1 2 0 0
    12345 Site2 3 0 0
    12345 Site1 0 1 0
    12345 Site1 0 1 0
    12345 Site2 0 1 0
    12345 Site2 0 1 0
    12345 Site1 1 0 1
    12345 Site2 2 0 -1


    However i need to consolidate the Records into by PartNumber and Site with a grand total of parts (ItemsIn - ItemsOut + Adjustment)something like below

    PartNumber Site TotalOnHand
    12345 Site1 1
    12345 Site2 2

    is this achievable at all, the consensus among my colleagues is that it isn't ?

    Kind Regards
    Zippy483
    Last edited by zippy483; 10-15-2020 at 04:32 AM.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Looks easy. Start a query with the two fields plus your calculation. Click on the Totals icon in the ribbon. Change Group By to Sum on the calculation and see what you get.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    is the Site2 total in hand correct? your example has 5 in, 2 out and a -1 adjustment which leaves 2, not 0

  4. #4
    zippy483 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    26
    Quote Originally Posted by Ajax View Post
    is the Site2 total in hand correct? your example has 5 in, 2 out and a -1 adjustment which leaves 2, not 0
    Ajax, you are of course correct, a little bit of dodgy arithmetic on my part, corrected that now

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

Similar Threads

  1. Consolidating Table Structures
    By chemguy120 in forum Database Design
    Replies: 8
    Last Post: 05-16-2018, 02:29 PM
  2. Consolidating Same Clinic Names
    By avv in forum Access
    Replies: 2
    Last Post: 10-27-2017, 11:20 AM
  3. Replies: 15
    Last Post: 11-30-2012, 01:36 PM
  4. Consolidating Records
    By OldUser in forum Queries
    Replies: 2
    Last Post: 10-03-2011, 05:13 PM
  5. Consolidating Code
    By eww in forum Programming
    Replies: 4
    Last Post: 02-08-2011, 10:26 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