Results 1 to 3 of 3
  1. #1
    ch74home is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    1

    Query - PO Numbers with multiple receives

    Hello All! Im running into an issue with a query I need in Access. Im getting data duplication in my query results.



    The end goal is to do vendor evaluations based on the date products are ordered, date promised, and date received. Our erp software stores this data in 3 access tables.

    I setup a query linked by PO number to all 3 tables. When I run the query, I get the correct results, but multiplied by the number of RECEIVES on the PO. If the PO does contain multiple receives on it, there is another field in one of the tables that contains the "Receive Number" field. When we order multiple products from a vendor on one PO and they deliver those products on 2 different dates, the data gets multiplied by the number of times received against the PO indicated by the receive number. So the only true correct result are those where the PO contained only 1 receive the way I current have the query setup.

    Product A and Product B are ordered on 3/1/2019 PO Number 1234. The vendor promised to deliver both products by 3/7/2019. We received Product A on 3/6/2019 which would create PO 1234 Receipt 1 and product B on 3/9/2019 which would create PO 1234 Receipt 2. I would get 4 results, 2 receives X 2 products.

    Data looks like this:
    PO-1234, RECEIPT NUMBER-1, Product-A, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/6/2019
    PO-1234, RECEIPT NUMBER-1, Product-A, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/6/2019
    PO-1234, RECEIPT NUMBER-2, Product-B, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/9/2019
    PO-1234, RECEIPT NUMBER-2, Product-B, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/9/2019

    Data should look like this:
    PO-1234, RECEIPT NUMBER-1, Product-A, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/6/2019
    PO-1234, RECEIPT NUMBER-2, Product-B, PO DATE-3/1/2019, DUE DATE-3/7/2019, REC DATE-3/9/2019


    So the question is, how can I accommodate for the possibility that multiple receives might happen on a PO? Could someone point me in the right direction please? Let me know if im not clear enough in my description. Thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    change the query to ignore duplicates:
    SELECT DISTINCT * FROM TABLE

    (aka set query property UNIQUE VALUES = TRUE)
    You may have an extra field in the query preventing unique.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If you enter PO and Receipt records for each product, perhaps do a compound join on PO and Product.
    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.

Similar Threads

  1. Replies: 10
    Last Post: 10-05-2015, 09:09 AM
  2. Multiple auto numbers in forms
    By clark615 in forum Forms
    Replies: 1
    Last Post: 08-13-2013, 04:23 PM
  3. Replies: 4
    Last Post: 11-15-2012, 09:55 PM
  4. Multiple account numbers
    By BenM912 in forum Forms
    Replies: 1
    Last Post: 03-21-2011, 10:47 AM
  5. Replies: 2
    Last Post: 03-10-2009, 05:14 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