Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting and totals in a query (2002)

    I have setup a query to count the number of dates entered in a field.

    I then have another query to add up the numbers that came from the first query.

    What I want to get is the total number on dates by each grade. That is not what I'm ending up with.

    Any ideas on how to approach this. Sample database attached.

    Thanks,

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting and totals in a query (2002)

    Your first query groups (among others) on InqDate, it doesn't count InqDates. It counts records (or IDs if you prefer) for each combination of SchoolYear, InqDate, Division and Grade.

    I don't understand what exactly you want to accomplish with your second query. Can you explain it in simple terms?

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting and totals in a query (2002)

    What I want to end up with is the total number of inquiries (InqDate) between given dates for each grade.
    Example:
    Grade 6 - 5 inquiries
    Grade 7 - 8 inquiries
    Grade 8 - 10 inquiries

    My original Total query gives me 2 or more totals for some grades

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting and totals in a query (2002)

    Set the Total option for CountOfInqDate to Sum instead of Group By.

    But you can accomplish the same result in a single query. See the query qrySimple in the attached version.
    Attached Files Attached Files

Posting Permissions

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