View Single Post
  #2 (permalink)  
Old April 8th, 2004, 09:10 AM
jurgenw jurgenw is offline
Authorized User
Join Date: Feb 2004
Location: Edmonton, Alberta, Canada.
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts

Create a query of Counts and name it qryEmployeeReasonCount

SELECT EmployeeName, Count(Reason) AS CountReason
FROM tblEmployeeReason
GROUP BY [EmployeeName & ' ' & Reason, EmployeeName
ORDER BY EmployeeName & ' ' & Reason;

Then take the max from that query by writing a new query referencing that query:

SELECT EmployeeName, Max(CountReason) AS MaxCountReason
FROM qryEmployeeReasonCount
GROUP BY EmployeeName;

This isn't finished as I didn't take the time to pull the reason but should get you pointed in one workable dirction.

J├╝rgen Welz
Edmonton AB Canada