MS Access Request - Choose the Latest Date

I have a query that I am developing that captures data from several different tables. In MS Access 2010, how do I create one of the query columns so that it returns the date of the most recent of a series of dates for each user in the table:

Example data from the table:

  userid: |  appointment:
 000001 |  10/05/2009
 000001 |  10/10/2010
 000001 |  11/05/2010
 000002 |  12/05/2009
 000002 |  12/30/2010 

expected output for field request:

  userid: |  appointment:
 000001 |  11/05/2010
 000002 |  12/30/2010 
+4
source share
2 answers
SELECT userid, Max(appointment) AS most_recent FROM YourTable GROUP BY userid; 
+4
source

SELECT B.Job_Emp_ID, B.JobTitle, B.Salary, B.AssignmentDate FROM tbl_Emp_Job_Assignment as B INNER JOIN tbl_Emp_Job_Assignment as A ON (B.Job_Emp_ID = A.Job_Emp_ID and B.AssignmentDate_ A. B. .JobTitle, B.Salary, B.AssignmentDate;

This works great! He gives the last assignment and date of appointment.

0
source

All Articles