getting the most current date for each client

Jimcb8

Registered User.
Local time
Today, 02:38
Joined
Feb 23, 2012
Messages
98
I have two tables:
1. Client Info table which contains the following fields:
Clientid
LastName
FirstName

2.DatesDistribution table
Clientid
DateAttended

The relationship is one to many for these tables.

I have been trying to create a query that will show the following:
Clientid
LastName
FirstName
DateAttended (where this field only shows the most current date that the client visited)

Example:
ClientInfo has 2 records:

Clientid=jsmith
LastName=Smith
FirstName=Jim

Clientid=tjones
LastName=Jones
FirstName=Tom

DatesDistribution 4 records:
Clientid=jsmith
DateAttended=05/21/2013
Clientid=jsmith
DateAttended=04/02/2013
Clientid=tjones
DateAttended=02/01/2012
Clientid=tjones
DateAttended=06/10/2013

Result that I am trying to get is:

Jim Smith 05/21/2013
Tom Jones 06/10/2013

I have tried grouping the records in Client Info table to get distinct names and using a Last function to get the most current date with little success.

Any help will be appreciated. I am relatively new to Access 2010.

Thanks

Jim
 
Use Max() if you want the latest date. I think Last() will give you the last date in the current sort order, but if you haven't sorted by the field you need . . .
 
That did the trick!!!!!!

Thank you so much I can't tell you how much I appreciated your help

Jim
 

Users who are viewing this thread

Back
Top Bottom