Results 1 to 2 of 2
  1. #1
    IzzyKap is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    10

    Count total number of records and specific records in a query column


    I am a newbie to Access DB and am stuck trying to count total records in a query column as well as those that fit a specific criteria within that column. For example, I have a column, ClientSt, representing different US states where my clients are based. I would like to be able to get a total client count for the ClientSt column and then get a count of clients from a specific state, eg AL. Any help is greatly appreciated.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,031
    Are you building an aggregate (GROUP BY) query?

    Create a field with expression. Try:

    AL: Sum(IIf([ClientSt]="AL", 1, 0))

    Or GROUP BY on ClientSt and use DCount() to return count of all records in table.

    Alternatively, build a report that uses Grouping & Sorting with aggregate calcs functionality. This will allow display of detail records as well as aggregate calcs in group header/footer.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 10
    Last Post: 09-21-2012, 09:00 AM
  2. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  3. count the number of records from a query
    By Nixx1401 in forum Queries
    Replies: 4
    Last Post: 05-24-2011, 06:45 PM
  4. Replies: 3
    Last Post: 08-26-2010, 02:11 PM
  5. Replies: 7
    Last Post: 07-22-2010, 01:14 PM

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 - Senior Forums