Results 1 to 4 of 4
  1. #1
    con-con
    Guest

    Most Current date in a query

    I am running a query with an ID that returns multiple records with different dates/times. However, I only want the most current date/time. For the date/time field on the query grid, how do I specify most current date/time?

  2. #2
    Star Lounger
    Join Date
    Feb 2001
    Location
    Wirral, Merseyside, Merseyside, England
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Most Current date in a query

    Within the query use the totals and select first in the total field to select the first date which should give you the most recent date. If this presents you with more records it is because of the rest of the criteria.

    In this case do a query just selecting the first date and link this query to the first.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Most Current date in a query

    Make sure you sort the query by date descending, or the first date will not neccesarily be the most recent date.
    Charlotte

  4. #4
    PatriciaWilliams
    Guest

    Re: Most Current date in a query

    If you just want a single record return, then use the "Totals" symbol (the backwards "E") while in the design interface, and select your ID field and your date. Leave the ID fld as "group by", and chose "max" in place of "group by" for your date fld. This should give you the single most recent date for a particular ID (one record if you're filtering for ID or only have one ID).
    thx
    Pat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •