467,073 Members | 1,262 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,073 developers. It's quick & easy.

Calculating Averages for multiple columns, with multiple Recordsets

I have a table with over 12,000 entries. I have created a form (with the help of this forum) that will return the search results based upon the stop and stop time selected. See post http://www.thescripts.com/forum/thread757933.html for additional context.

Now, I want to take this a step further by querying this table by clicking a new command button on the form which will open up a new query displaying the average number for six of these columns for each distinct stop. So, if stop "abcd" has 6 records returned from the search, when I click the new command button, I want to then calculate the averages for the specified columns: ON, OFF, LOAD, LOAD_FACTOR, SCHED_DEV, SCHED_RUNTIME, ACTUAL_RUNTIME) and display a new table showing the average of the sum of the values for each individual column, so at the end, I will have 1 record, displaying the six columns with the average (oh, and rounded to two decimal places), along with the other columns.

I know somewhere out there has done something similar...thanks in advance!

Jan 29 '08 #1
  • viewed: 3199
1 Reply
Expert 256MB
If you're wanting to do an average of a particular column of data, then all you have to do is simply add the AVG() function to that particular data item in the query.

If you're wanting to take multiple columns of data and due an average, then you would need to add all of them up in a single column and then apply the AVG() function to it.

If you need more detail, then I would need to see what you have setup so far, the example that you've given in the previous post didn't have what information you have on the form very clearly.

Kind of hard for me to give a more detail answer with out a better understanding of your database structure.


Joe P.
Feb 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Stephen Miller | last post: by
16 posts views Thread by Randy Harris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.