Determine First and Last Entries for Field

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

Guest

I have a table with two fields: Date and UserName.

I want my report to show the user name along with the first and last date,
indicating the first and last times they logged into a particular application.

I've tried using DFirst, DLast; DMin and DMax, but I'm not getting these
values per UserName - I'm getting the first and last dates in the entire
table for every UserName entry -- the data isn't changing.

Any help would be greatly appreciated. I'm using Access 2000.
 
That SQL should give you a list of the user along with first and last date of
each one of them

SELECT MyTable.UserName, Max(MyTable.MyDate) AS MaxMyDate,
Min(MyTable.MyDate) AS MinMyDate
FROM MyTable
GROUP BY MyTable.UserName
 
Back
Top