Results 1 to 2 of 2

Thread: Averaging Count() Records

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    I have been asked to code a page which will list everyone in a database, give the total number of records for each rep (between dates specified) and average a field called "Score".

    I know the idea is to SELECT Count(Score), ... which will let me list each rep and and the number of records for each. I have the page that is doing that right now, but the % is what I'm having a problem with. How do I make it add all scores together and then divide by rst(intRecordCount)?
    If you think education is expensive, try ignorance.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    See if SELECT AVG(Score) ... works. Or if that doesn't, see if SUM(Score) works, get that and divide by the count. They work with Access, I'm unsure if they're standard SQL. Else, get the count and then loop through the recordset, sum it up yourself and divide by the count.

    Josh
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width