Selecting the latest date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to pull the latest (or most recent) week_ending value for each user in
my time tracking database.

Each employee enters time and selects the week ending field. I am to
display Year to Date totals but since not everyone works each week, it would
be helpful to know the last week_ending value for each employee.

I am experimenting with the MAX function but cannot seem to get it to work.

Thanks in advance.
 
Here's an example using the Orders table from the Northwind sample database.
This query will return the date of the most recent order for each employee
....

SELECT Max(Orders.OrderDate) AS MaxOfOrderDate, Orders.EmployeeID
FROM Orders
GROUP BY Orders.EmployeeID;
 

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

Back
Top