View Full Version : Filter report for last date


trackmedic
10-07-2010, 07:49 AM
I have a report that shows the dates of employee visits. I would like to filter this to show only the last date an employee visited.

example:

Instead of

John doe 01/01/2010
John doe 01/02/2010
John doe 01/03/2010

I would like the report to show

John Doe 01/03/2010

As usual, thanks in advance!

vbaInet
10-07-2010, 07:51 AM
If those are the only fields being pulled then:

SELECT FullName, Max(DateField) As MaxDate
FROM TableName
GROUP BY FullName;

It may not work if you add more fields but try it out.

trackmedic
10-07-2010, 07:56 AM
Where do I place this? In the query or in the date field on the report?

vbaInet
10-07-2010, 07:58 AM
In the sql view of a blank query but you need to substitute the right field names and table name in.