Results 1 to 6 of 6
  1. #1
    drive105dj is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    3

    need some help with query

    I have the following two queries (and I made tables for them as well)

    Table A


    Item, Lot, Qty in Location A, Qty in Loc B, B's Cost, A's Cost

    Table B
    Item, Lot, Qty in Loc C

    There are items in both tables that aren't in the other table but most items match. How do I make sure that all items and lots are accounted for in one report and that the report turns out like the following?
    Qty in A Qty in B Qty in C
    Item abcd
    Lot 123 22 0 300
    Lot 456 41 16 42
    Item efgh
    Lot 128 7 7 7
    Item hijk
    Lot 2 21 22 21

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Why do you have two tables and two queries?

    Use report Grouping & Sorting features.
    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
    drive105dj is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    3
    Quote Originally Posted by June7 View Post
    Why do you have two tables and two queries?

    Use report Grouping & Sorting features.

    I have a table version made of each query in the event my help from this site requires either a table or a query. I can use either the tables or the queries. I just need to mash them together so all items and lots show along with corresponding quantities for each loc.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Still don't understand why there are two of each as opposed to 1 of each.

    Need to join the 2 whichever to a 'master' dataset of Items.
    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.

  5. #5
    drive105dj is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    3
    Quote Originally Posted by June7 View Post
    Still don't understand why there are two of each as opposed to 1 of each.

    Need to join the 2 whichever to a 'master' dataset of Items.
    The 2 queries come from two different companies. There is one with loc a and loc b. There is another with loc c. I made a table from each query in the event I needed them. I need to join them to a master, but when I join on item or lot, I get multiple lines for same data.

    I am using design view.

    My completed project should be item (column a) and lot (column B) down the side with loc a (column c), b (column D), and c (column e) in different columns.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Really should be one table with another field for company ID. Multiple similar name fields is not a normalized data structure.

    Yes, there will be multiple lines for same data if each table has multiple records for the same item and/or lot.

    Is the combination of item and lot unique in each table? Do you have a master dataset of all item and lot combinations? If not, dataset can be created with a query that includes both tables without join and pulls only the item and lot fields (a Cartesian relationship). Then join the two whichever to the master by compound link on item and lot.
    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.

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

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