find the most frequent value

Spira

Registered User.
Local time
Today, 10:35
Joined
Feb 23, 2004
Messages
35
hi, im making a computer repair system and would like to know how to extract the most frequent customer ID (integer) using a query. thanks :confused:
 
SELECT TOP 1 UserID, Count(*) AS CallCount
FROM tblRepair
GROUP BY UserID
ORDER BY Count(*) DESC;
 
Pat Hartman said:
SELECT TOP 1 UserID, Count(*) AS CallCount
FROM tblRepair
GROUP BY UserID
ORDER BY Count(*) DESC;


where do i put this?
is there any way of putting this in a QBE? ( i only know how to use this)
thanks
 
Switch to SQL view.
Change UserID to your field name (both places)
Change tblRepair to your table name

Once you have changed the two names, you can switch to QBE view if you prefer.
 
Pat Hartman said:
Switch to SQL view.
Change UserID to your field name (both places)
Change tblRepair to your table name

Once you have changed the two names, you can switch to QBE view if you prefer.


thanks for your help, it now works!!
 

Users who are viewing this thread

Back
Top Bottom