Database Question

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

Guest

I have to run a query that displays the most frequent results for a field. Is
there a way I can tell access to only pull the most frequent results from a
specified field?
 
I have to run a query that displays the most frequent results for a field. Is
there a way I can tell access to only pull the most frequent results from a
specified field?

Create a Totals query, grouping by the value of the field and counting
records; and sort by that count:

SELECT Fieldname, Count(*) AS Hits
FROM yourtable
GROUP BY Fieldname
ORDER BY Hits DESC;

You can also use the Top Values property of the query to return (say)
only the top ten hits.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Locking Out 2
Database size 2
Need help with a query 1
Run 2nd query using results from 1st query 0
#deleted 2
Add autonumber to a large table? 0
Epic Games freebies 2
Design and layout for Order Analysis? 5

Back
Top