query to retrieve most recent information

M

mcnews

i need to create a query that will return the most recent information
for a given person. each person may have multiple name, address,
telephone, and/or event records. the event record will contain an
entry date.
so my questions are:
what's the best way to keep these records in sync and
how to build a query to retrieve the data as needed.

tia, mcnewsxp
 
M

mcnews

i need to create a query that will return the most recent information
for a given person. each person may have multiple name, address,
telephone, and/or event records. the event record will contain an
entry date.
so my questions are:
what's the best way to keep these records in sync and
how to build a query to retrieve the data as needed.

tia, mcnewsxp

i just reread my post and it does not describe what i need. drifted
off somewhere....

i just need to know how to use a date field in a query to retrieve the
most recent of a set of records.

tia,
mcnewsxp
 
J

John Spencer

Best Guess is you need a subquery. However since I have no clue about your
table structure, the following is a rather generic SQL statement.


SELECT YourTable.*
FROM YourTable
WHERE EntryDate =
(SELECT Max(entryDate)
FROM YourTable as Tmp
WHERE Tmp.PersonID = YourTable.PersonID)

Check out Allen Browne's page on subqueries.
http://allenbrowne.com/subquery-01.html

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top