Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help in writing query

Status
Not open for further replies.

cancer2006

Programmer
Aug 25, 2006
45
US
I am working in access97 need help in writing a query
Table1 has two columns with ID and NAME.
Table2 has has two columns, ID and CHECKDATE.

In Table2, there are multiple checkdates associated per ID

I like to run a query which will give me the highest checkdate on each employee in Table2

Select table2.checkdate, table1.name
inner join on table1
where table2.id = table1.id;

This qurey will result in all the checkdates in table2.

Any ideas. Thank you

 
SELECT table1.name, Max(table2.checkdate) AS LastDate
FROM table1 INNER JOIN table2 ON table1.id = table2.id
GROUP BY table1.name

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top