Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    12

    Question Unanswered: need syntax help

    How do i identify the 5 most recurring data, and get the number of times each of the recurred?

    e.g.

    Serial number Number of recurrances
    1579 63
    2944 49
    6843 43
    2368 37
    2455 28

    Thanks

  2. #2
    Join Date
    Jun 2004
    Posts
    92
    Quote Originally Posted by Jemmo
    How do i identify the 5 most recurring data, and get the number of times each of the recurred?
    This query should work for you, just make sure you change the tbl name and field names if you need to:


    Code:
    SELECT TOP 5 First(tblserialnumbers.serialnumber) AS [Serial Number], Count(tblserialnumbers.serialnumber) AS [Number of recurrances]
    FROM tblserialnumbers
    GROUP BY tblserialnumbers.serialnumber
    HAVING (((Count(tblserialnumbers.serialnumber))>1))
    ORDER BY Count(tblserialnumbers.serialnumber) DESC;
    Last edited by sionus; 07-29-04 at 00:44.

  3. #3
    Join Date
    Jul 2004
    Posts
    12

    Smile thanks!!!!!!!

    wow it works! thank you so much man. I'm such a neeewwwbbbeeeee

    Thanks!

Posting Permissions

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