PDA

Click to See Complete Forum and Search --> : Averaging Count() Records


artsapimp
Feb 19th, 2001, 04:48 PM
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)?

JoshT
Feb 20th, 2001, 09:54 AM
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