Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Posts
    14

    Unanswered: Counting Records in Report

    My report is based on query "qry_school_test_results". In my report, I have a page footer [SchoolName].

    In my report page footer, I want to display the total number of records in the query that meet certain criteria.

    e.i: count only records where field "Deficient" = English.

    I cannot set criteria using COUNT function. The DCOUNT function is not appropriate because (even though I can set criteria) it counts all records in query, not just records belonging to [SchoolName].

    Any suggestions???

  2. #2
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    set a variable = to the school name you are filtering on and then set a text box = "select count(*) from table_name where school_name = variable"
    Jim

  3. #3
    Join Date
    Apr 2002
    Posts
    14
    Originally posted by JDionne
    set a variable = to the school name you are filtering on and then set a text box = "select count(*) from table_name where school_name = variable"
    Jim
    Thank you. Though, I don't understand how to implement your solution. Can you give me a basic example?

    Alf

  4. #4
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    ok try this

    you should have a text box with the school name it it. lets call that School_text

    in the footer of the report add a text box lets call this rows_text

    set the rows_tex box data source to
    = select count(*) from data_table where [data_table].[school] = school_text

    that should make a dynamic query that will change every time the data in the school_text box changes.

    Let me know
    Jim

  5. #5
    Join Date
    Apr 2002
    Posts
    14
    After creating a text box SCHOOL_TEXT as a variable to store the school name, I was able to use that variable in the criteria part of the DCOUNT function.


    Thanks for your expertise, worked great!

    Alf

  6. #6
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    woohoo sounds wonderfull

    Glad to help
    Jim

Posting Permissions

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