Results 1 to 3 of 3
  1. #1
    jtmott is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    17

    How to return full line of query in MS Access 2016

    Hello,
    I am querying a table that has multiple entries. I need to find a way to return the entire line of each record.
    Below is a sample of the table. I need to return the entire record based on "ODPRD" and the lowest "OOPNO".


    Example:
    ODPRD OORD OOPNO OOPDS OWRKC OQTY OQTYP % Comp
    10043 215402 20 SCR MCH TO PRINT-10043 2600 2000 0 0
    10043 215402 25 DEBURR HOLE 2700 2000 0 0
    10043 215402 30 STAGE TO WAREHOUSE 8400 2000 0 0
    10051 213277 20 DRILL 5/8" HOLE TO 10051 2700 500 0 0
    10051 213277 30 DEBURR HOLE 2700 500 0 0
    10051 213277 40 STAGE TO WAREHOUSE 8400 500 0 0

    Results needed:
    ODPRD OORD OOPNO OOPDS OWRKC OQTY OQTYP % Comp
    10043 215402 20 SCR MCH TO PRINT-10043 2600 2000 0 0
    10051 213277 20 DRILL 5/8" HOLE TO 10051 2700 500 0 0
    Thank you for any help!

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    create a select query using query design view including just 3 fields:
    ODPRD OORD OOPNO

    then option it to be an Aggregate query (up in ribbon is sigma symbol like large E)
    leave the first 2 fields in their default 'Group On' but change OOPNO to MIN

    Save this query with a name: A1

    Then make a new query - adding your table and also A1. Draw join lines between the 3 fields. Add all the fields of the table into the query.

    This will give the results you seek.

  3. #3
    jtmott is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    17
    That worked great Thanks for the help!

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

Similar Threads

  1. filling in fields to make a full line
    By philsan20 in forum Access
    Replies: 1
    Last Post: 03-19-2015, 02:37 PM
  2. Replies: 8
    Last Post: 08-20-2013, 03:03 PM
  3. search for folder and return full path
    By eladz949 in forum Programming
    Replies: 3
    Last Post: 12-23-2012, 02:26 PM
  4. Replies: 2
    Last Post: 08-05-2011, 01:24 PM
  5. Replies: 5
    Last Post: 02-09-2011, 11:22 AM

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