Results 1 to 4 of 4
  1. #1
    beezelbuz is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    2

    Beginner needs help. Trying to create simple Totals query

    Hello everyone and thanks for the assistance.



    I have an Items table with primary key as "Item ID"
    I have an Order Line Items table with primary key as "Order ID"

    Order Line Items table has the order ID and the number of items ordered for each ID
    I am trying to create a query that Prints the item name in column 1 and in column 2 post the total each was ordered.

    Pics of tables are included.
    Attached Thumbnails Attached Thumbnails ItemsTable.PNG   OrderLineItemsTable.PNG   TableQuery.PNG  

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Need to link the Item ID fields in query.

    Then maybe you want Sum(Quantity) instead of Count([Item ID]).

    Strongly advise not to use space in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    I think you need to add as the first field in the totals query the [Order ID] (Group By), then the [Item ID] or [Item Name] from Items (you need to join them on Item ID as June7 said) and finally TotalPurchased: Sum(Quantity).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    beezelbuz is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    2
    OMG! Thank you so much!!! Needed to JOIN the ItemID fields in the two tables. Fantastic it now works!

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

Similar Threads

  1. Replies: 2
    Last Post: 11-10-2017, 07:52 PM
  2. Simple Beginner Question
    By dbmiller5 in forum Queries
    Replies: 9
    Last Post: 07-19-2016, 01:02 PM
  3. Replies: 5
    Last Post: 07-12-2015, 09:33 PM
  4. Replies: 10
    Last Post: 05-01-2014, 12:02 PM
  5. A very simple query re totals........
    By txacoli in forum Queries
    Replies: 6
    Last Post: 12-31-2010, 01:02 PM

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