By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Calculating Averages for multiple columns, with multiple Recordsets

P: 12
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 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
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 374
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.