Results 1 to 4 of 4
  1. #1
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376

    Need last purchased Price by Part Number from query


    Hello all,

    This has been beating me up for a while now. I want to add some info to a report for the last purchased price for each item in the report. I cannot get a query that will give me 1 line per part number with the last price paid. I have the "Transactions Table" which holds the data for parts coming in, being consumed and going out. What I want is a query that comes up with 1102 part numbers and a value in the UnitPrice field for most of them, ( not every PN will have a UnitPrice because they get used in another upper level Part).

    I have included a file with what I believe are the tables needed, but no reports, forms, etc for confidential reasons. The Pic below shows what I get returned to give you and Idea of what I am trying to achieve but this should have far more parts with prices than it does.


    Click image for larger version. 

Name:	Unit Price Issue.PNG 
Views:	13 
Size:	52.2 KB 
ID:	38805



    MRP 6-19-19 In Devlopment.zip

    I hope I have explained what I am trying to achieve good enough. If not I will try to be clearer based on responses.

    Thanks in advance

    Dave

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Options:

    1. TOP N query to pull the 'latest' record for each part, review http://allenbrowne.com/subquery-01.html#TopN

    2. complex domain aggregate function expression, review https://www.accessforums.net/showthread.php?t=77202
    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
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    June7,

    Can such a query be constructed in the Query Builder? I am not strong at all in SQL.

    Thanks

    Dave

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I usually end up building in SQLView for option 1.

    Can certainly build expressions using domain aggregates in DesignView.
    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. Query to pull price from master price
    By jonathanoeijoeng in forum Queries
    Replies: 3
    Last Post: 03-21-2019, 02:18 PM
  2. Replies: 2
    Last Post: 06-02-2017, 09:30 AM
  3. Replies: 6
    Last Post: 07-16-2013, 11:13 PM
  4. Replies: 1
    Last Post: 12-06-2012, 08:16 PM
  5. Replies: 2
    Last Post: 03-02-2011, 01:43 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