Results 1 to 4 of 4
  1. #1
    robbarkley is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    2

    Question lowest cost vendor


    I'm trying to set up a query to identify the lowest cost vendor. I have set up three tables: 1. a product table, 2. a vendor product table and 3. a Vendor Table. The vendor products are linked to the vendor table via the vendor ID. The vendor products are linked to the Products in the product table off the Product ID in the Vendor Product table. Each Product can have multiple vendors. I want to identify the Primary vendor using a couple of criteria but primarily using the lowest cost. What is the best equation for building this query?

    thanks

    RB

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Use TOP 1 and sort by. Review http://allenbrowne.com/subquery-01.html#TopN
    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
    robbarkley is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    2
    i would be lieing if i had any clue what you were talking about. i'm a ridiculously inexperienced with access

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You want the lowest cost vendor for each product.

    Build a query following Allen Browne's 'TOP N for Each Group' example - your 'group' is product.

    Assuming there are Cost and ID fields in VendorProduct, something like:

    SELECT * FROM VendorProduct WHERE ID IN
    (SELECT TOP 1 ID FROM VendorProduct AS Dupe WHERE Dupe.ProductID = VendorProduct.ProductID ORDER BY Dupe.Cost);
    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: 1
    Last Post: 07-20-2015, 12:39 PM
  2. Vendor Time Cost Tracking Database
    By mjohnson02 in forum Database Design
    Replies: 1
    Last Post: 03-05-2014, 01:38 PM
  3. Replies: 7
    Last Post: 11-29-2012, 11:36 AM
  4. How to pull lowest value?
    By TommyRex in forum Access
    Replies: 5
    Last Post: 10-25-2010, 02:09 PM
  5. Vendor Selection!!
    By skylitz in forum Access
    Replies: 2
    Last Post: 08-16-2010, 04:09 AM

Tags for this Thread

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