Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    15

    Unanswered: Calculating the mode value in a query?

    In a summary query, I need to return the value that shows up the greatest number of times in a certain column of a table. Is there a function built in to Access or an easy way to perform this, or do I have to make my own function to handle this?

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    I think this query this will do what you want

    Code:
    SELECT TOP 1 Table1.Data
    FROM Table1
    GROUP BY Table1.Data
    ORDER BY Count(Table1.Data) DESC;
    I Think (have go to go), but this will return the item that occurres most in the 'Data' field in Table1 !

    Hope that is wat you hat in find ?

    MTB

  3. #3
    Join Date
    Jan 2005
    Posts
    15
    This looks good - I will embed this in my query and see what it spits out. Thanks so much for your reponse; will keep you posted on the result!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •