Much Better Description

G

Gary B

ClientTable:
ClientPrimaryAutoIncKey
ClientName

ClientHistoryTable:
ClientHistoryPriAutoKey
ClientForeignKey
ClientHistoryNote

In this One To Many Relationship, I want to return the following:

ClientName, LastClientHistoryNote

Sorry, Thanks!
 
S

Steve Schapel

Gary,

Here is the SQL of a query that will do this...

SELECT ClientTable.ClientName, ClientHistoryTable.ClientHistoryNote
FROM ClientTable INNER JOIN ClientHistoryTable ON
ClientTable.ClientPrimaryAutoIncKey = ClientHistoryTable.ClientForeignKey
WHERE ClientHistoryTable.ClientHistoryPriAutoKey In (SELECT
Max([ClientHistoryPriAutoKey]) FROM ClientHistoryTable WHERE
[ClientForeignKey]=[ClientTable].[ClientPrimaryAutoIncKey])
 
Top