G
Guest
why do I get just the sum with Avg([column1]+[column2]...)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The said:why do I get just the sum with Avg([column1]+[column2]...)
why do I get just the sum with Avg([column1]+[column2]...)
Damian S said:You shouldn't, you should get the average... Are you checking that column1
and column2 contain data (ie: are not null)?
Damian.
The Dummy in Access for Dummies said:why do I get just the sum with Avg([column1]+[column2]...)
Rick Brandt said:The said:why do I get just the sum with Avg([column1]+[column2]...)
Aggregate functions in databases aggregate values in a single column across many
rows. They do not aggregate multiple arguments fed into them. The "average" of
summing a bunch of fields is the same as the sum because there is only one value
to take the average of.
Needing to aggregate like this (usually) suggests a flawed database design that
is more like a spreadsheet than a proper database table.
why do I get just the sum with Avg([column1]+[column2]...)
Are you expecting Avg() to average the values of Column1, Column2,
etc.? It won't; Avg() averages across RECORDS not fields, and you're
not passing a list of fieldnames anyway - you're adding all the values
and then averaging that sum.
What's actually in your table?
What result do you expect?
John W. Vinson[MVP]
Each column has the monthly sales (column1=Jan's). Each row is for a
particular item. In query design, I wanted to get the average and standard
deviation for each row (item); based on the values for each column. Any idea
on how I should approach this?
Thanks for the advise, I believe I'll try another way...the problem is that I
am only extracting the data with ACCESS, from a another database (which
doesn't allow editing or writing). I'll have to search for the table that has
that formatting (records), rather then the spreadsheet table they are using.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.