Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the Mode(statistical) for a Access

Status
Not open for further replies.

BradB

MIS
Jun 21, 2001
237
US
I'm trying to return the most common error for a given set of data by the users name. In statistics, we used the Mode. Is there an easy way to return the most common error?

(The Mode) 50 records returned
Ex. Name Most common Error Error Desc.
Brad Boydston 17 Data Entry
Paul Williams 5 Syntax Error
Michael Godinez 17 Data Entry

Brad Boydston
bboydston@bertnash.org


 
Not sure of the code, but what if you grouped by name and error, and then used the MAX function based on the COUNT function? Something like:

SELECT a.EmpName, MAX(COUNT(a.ErrorCode)), b.ErrorDesc
FROM MyTable as a, ErrorCodes as b
GROUP BY EmpName

Probably going to need a sub-query. I know that code isn't right, but I don't really have the time to play with it, and it may give someone else an idea.
Terry M. Hoey
 
There is an answer on the Microsoft Knowledge Base. Go to Miscrosoft.com Select Knowledge Base in the Support menu. Then search for product=Access and statistical

 
Crosstab on the Value as count.

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top