Results 1 to 2 of 2
  1. #1
    DHIGHTO is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    30

    Query to find last date

    Hey guys,



    I'm trying to query to find the latest date of a file that has multiple dates. I need the criteria to be the last date, and not just display the last date so I can find the transaction. I thought Dmax may work, but I don't know what my criteria would be. I put an example below. I'm looking for the last date, which would be 5/5/2014. I can't put in the date as the criteria since I am using this for a large amount of files, and the dates differ.

    File # setupdate transaction
    100001 1/1/2014 1
    100001 3/5/2014 2
    100001 5/5/2014 3
    Thanks!

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Do an Aggregate (Totals) Query.

    Start a new query, and add the setupdate field.
    Click on the Totals button (looks like a Sigma).
    This will add a "Totals" row under that field.
    In the "Totals" row, change the phrase "Group By" to "Max".
    This will return your latest date.

    If you would like to return the other fields associated with this Max Date, then create a new query linking your original table to the Aggregate Query you just made on the Date field, and then return the fields you want.

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

Similar Threads

  1. Replies: 8
    Last Post: 07-11-2013, 07:24 AM
  2. Replies: 7
    Last Post: 09-10-2012, 03:40 PM
  3. Query to find all records after a certain date
    By Matt Parsons in forum Queries
    Replies: 2
    Last Post: 08-24-2011, 06:22 AM
  4. How to find missing date query
    By twhite in forum Queries
    Replies: 8
    Last Post: 09-02-2010, 02: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