Results 1 to 6 of 6
  1. #1
    cip315 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    3

    New to Access- help with counting rows

    I have one main table of data. I used queries to separate the data into certain subsets based on their values. I now have 5 query tables, four of which are subsets of the fifth. I want to compare the amount of rows per table to get a percentage. Is that another Query? How would I go about getting this?

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    you can do it using a Report - and its grouping feature - - from a common record source

    or you can do it - as you have started - via queries. You would need to do an AggregateQuery on your existing queries - that will return the record count; and then plug those values into a form/report.

  3. #3
    cip315 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    3

    aggregateQuery

    I tried that by entering the expression Expr2: Sum(Count(*)) and it told me I couldn't do a AggregateQuery there. I have it working in a report where it will print the two queries next to each other but I was looking for something like:

    value 1 ####
    value 2 ####
    value 3 ####
    Total ####

  4. #4
    cip315 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    3

    Example

    http://www.techonthenet.com/sql/count.php

    My table is up to example 3 here. I would like to add a lower row alloing a total, or even another column tracking the total.

  5. #5
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    it would appear that a standard report with group and sums set up will meet your need. if you do not know how to do this - you should get an Access text book in your version available at any big box book store or Amazon. these books all explain how to set up a Report with grouping and sums.... or you can play around - the wizard should help you step thru it when setting up a report.

  6. #6
    Xiaoding is offline Novice
    Windows 2K Access 2003
    Join Date
    Nov 2009
    Posts
    29
    Quote Originally Posted by cip315 View Post
    http://www.techonthenet.com/sql/count.php

    My table is up to example 3 here. I would like to add a lower row alloing a total, or even another column tracking the total.
    Getting the number form a report is tricky, didn't work for me.

    You can use DCOUNT to return the number of rows in a query.

    "DCount ( expression, domain, [criteria] )"

    which means, "expression is the field that you use to count the number of records.
    domain is the set of records. This can be a table or a query name.
    criteria is optional. It is the WHERE clause to apply to the domain."

    To use in a query,
    Expr1: DCount("TAG_NU","pm's feb") so, field, query name.

    Tag_NU is the filed use use to count, PM's Feb is the name of the query. It returns a column that gives you the count for each record in the set.

    Which leads to a problem, if you try to total the record count, you get a huge number. I had 4 tables, which I also wanted to use the record numbers for, to get a count for each. I made an additional query, to get a record count from the other 4 querys, and set the unique value to 1 or yes, so that I got only one result per query, then used that for my report. Hope this helps!

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

Similar Threads

  1. Exporting more than 65000 Access rows to Excel
    By TonyBender in forum Import/Export Data
    Replies: 8
    Last Post: 08-22-2013, 04:56 PM
  2. Counting Dates
    By JenBouchard in forum Access
    Replies: 1
    Last Post: 01-22-2010, 05:08 PM
  3. Access to Excel transferring multiple rows to single row
    By peter_lawton in forum Import/Export Data
    Replies: 10
    Last Post: 09-23-2009, 10:16 AM
  4. Replies: 0
    Last Post: 11-16-2008, 09:46 PM
  5. Counting rows
    By anishap in forum Access
    Replies: 0
    Last Post: 10-08-2008, 10:41 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