Most recent

G

Guest

I would like to develop a query that will give me the most recent date that a
contact has been contacted. I have a One to Many table association, that has
the date and activities associated with each contact. I would like to
determine what the date of the most recent activity is and be able to print
it in a report that lists each contact and the date of the contact.

I hope this is not too confusing.

Thanks.
 
K

Ken Snell [MVP]

Try using a subquery:

SELECT T.ContactID, T.ContactName,
(SELECT Max(Q.ContactDate)
FROM TableName AS Q
WHERE Q.ContactID= T.ContactID) AS LastContactDate
FROM TableName AS T;
 
J

JohnFol

Select ContactName, Max(ContactDate) from PeopleToContact, Contacts where
PeopleToContact.ContactID= Contacts.ContactID group by ContactName


(Sorry, can't remember the INNER JOIN syntax)
 

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

Top