Results 1 to 2 of 2
  1. #1
    byterbit is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Location
    Noou Yauk
    Posts
    32

    count the # of records sharing a code

    Trying to get a count of the number of records for each code; that is: 90000 records with a code field; some code "a" records have 1000 records and some code "b" records have 20000 records; I'd like to know !


    In other words; ther are perhaps 20 codes; there is a "code" field with these repeating codes; I'd like a count of how many records contain code "c" and how many have code "d", etc.
    I've tried this , and many many other variations !

    SELECT contacts.code Count(contacts.code) AS CountOfItemName
    FROM
    (SELECT DISTINCT code ) As q
    GROUP BY code;

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    the SELECT DISTINCT is what is throwing it off. All you need is
    SELECT code, Count(code) AS CountOfItemName
    FROM contacts
    GROUP BY code;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 09-13-2012, 05:18 PM
  2. File sharing lock count exceeded.
    By oleBucky in forum Forms
    Replies: 22
    Last Post: 03-09-2011, 08:26 PM
  3. Count Down and close on date code
    By ibraomer in forum Programming
    Replies: 1
    Last Post: 01-03-2011, 08:58 PM
  4. Count of records
    By Aston in forum Access
    Replies: 2
    Last Post: 03-30-2010, 05:20 AM
  5. File sharing lock count exceeded
    By bullwinkle55423 in forum Access
    Replies: 0
    Last Post: 03-22-2007, 11:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums