Problem in selecting the latest date

M

Mark

I am using Excel 97 Microsoft Query.

There are a number of tables from SQL Server for
analysis. For the same Registration Number, there are
more than one Registration Date (One in 2000, One in
2001 ...). I would like to know is it possible for me to
retrieve the row with latest date ? Is there any
suggestion ?

Thanks
 
K

Kieran

Mark,

it is certainly possible.

You need to rfence the table twice in MSQuery so that your final query
looks something like

Select
A.*
from TableName A
where
a.date = (
select max(B.date) from TableName B and
A.RegistrationNum = B.RegistrationNum)
 
M

Mark

Hi,

Thank you for your advice.

However, I find that the Registration Number is in a table
different from that containing the Registration Date. And
there are a number of tables linking between them.

Do you have any suggestion.
 

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