Problem with multi join query

V

Van T. Dinh

Post the SQL of your attempt on the current Status and the
corresponding (max) date.

Van T. Dinh
MVP (Access)
 
W

Walter Levine

Van,
You forced me to take another look and try again, and
guess what, it seems to work.
Below is what I came up with.
Thanks for your non-help.
Walter

--------------
SELECT A.SocialWorkerId AS SWId, [tbl_SOCIALWORKER].
[SOCIALWORKER], A.Date AS MaxOfDate, [tbl_CLIENTS].
[LAST], [tbl_CLIENTS].[FIRST], A.ClientId, D.StatusDate,
D.Status
FROM ((tbl_ClientSW AS A INNER JOIN tbl_CLIENTS ON
A.ClientId=[tbl_CLIENTS].[CLIENTID]) INNER JOIN
tbl_SOCIALWORKER ON A.SocialWorkerId=[tbl_SOCIALWORKER].
[SOCIALWORKERID]) INNER JOIN tbl_ClientStatus AS D ON
[tbl_CLIENTS].[CLIENTID]=D.ClientId
WHERE (((A.Date)=(SELECT MAX(B.Date) FROM tbl_ClientSW AS
B WHERE A.ClientId = B.ClientId)) AND ((D.StatusDate)=
(SELECT MAX(E.StatusDate) FROM tbl_ClientStatus AS E
WHERE D.ClientId = E.ClientId)));

--------------
 

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