Query by Date (latest)

  • Thread starter Thread starter Hank
  • Start date Start date
H

Hank

I have a database that has a one-to-many relationship between multiple
tables, but I need to query of the "many" tables and only get the most
recent entry of that table.

How would I query by the latest date of a given record?

Thanks!
 
I have a database that has a one-to-many relationship between multiple
tables, but I need to query of the "many" tables and only get the most
recent entry of that table.

How would I query by the latest date of a given record?

Use a Subquery. Create a Query joining the two tables; on the
datefield put a criterion

=(SELECT Max([datefield]) FROM [tablename] AS X WHERE X.[linkfield] =
tablename.[linkfield])

to select the maximum date for the current one-side table's ID.
 
Back
Top