Results 1 to 2 of 2
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    Find latest record

    I have a table that has these fields
    CarID
    Car Initials
    Car Number
    Customer
    CustomerBegin
    CustomerEnd

    There will be a row for each time a customer is in posession of a car. For example:
    CarID carinitials carnumber customername customerbegin customerend



    4968 TCLX 1004 Customer 6/25/18 7/31/2020
    4968 TCLX 1004 Customer 8/1/20 10/31/2020
    4968 TCLX 1004 Customer 11/1/20 12/31/2021

    There will be thousands of rows like that and for each car I want to just get the record with the most recent date in customerend. I am thinking I must need to do some kind of sub query. I have tried using top but it doesnt seem to work right.
    I need the query to just give me the red line for each Car.

    Thanks for any help.
    Last edited by tagteam; 01-20-2021 at 03:50 PM. Reason: update info

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,903
    Use Max() on the end date and group by CarID for the sub query and link on id from main query?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 1
    Last Post: 12-28-2017, 02:11 AM
  2. Find the latest purchase for each customer
    By Aubreylc in forum Queries
    Replies: 2
    Last Post: 11-09-2017, 09:26 AM
  3. Replies: 4
    Last Post: 07-04-2013, 12:07 PM
  4. Replies: 16
    Last Post: 10-23-2012, 10:42 PM
  5. Query to find latest date
    By Lockrin in forum Access
    Replies: 2
    Last Post: 12-16-2009, 10:00 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