Need join to merge last dated record in related table

M

mscertified

I have two tables that are related table A and table B. Table B contains
records that are date/time stamped.
What I need to do is to join the rows in table A with the last (in date/time
sequence) applicable record in table B.
How could I do this?
I'll be using SQL not the query builder.
 
J

John W. Vinson

I have two tables that are related table A and table B. Table B contains
records that are date/time stamped.
What I need to do is to join the rows in table A with the last (in date/time
sequence) applicable record in table B.
How could I do this?
I'll be using SQL not the query builder.

SELECT A.*, B.*
FROM A INNER JOIN B
ON A.joinfield = B.joinfield
WHERE B.datefield = (SELECT Max([datefield]) FROM B AS BPLUS
WHERE BPLUS.joinfield = B.joinfield);


John W. Vinson [MVP]
 

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