Average

B

Bill

I have a table organized by weather station and date but i need to average
across days. below is an example of my data.
STATION DATE TEMP AVG
station1 1/1/2005 20
station1 1/2/2005 24 22
station1 1/3/2005 26 25
station2 1/1/2005 20
station2 1/2/2005 24 22
station2 1/3/2005 26 25
 
A

Allen Browne

Use a subquery to calculate the average for the station + date.

If subqueries are new, here's an example:
http://allenbrowne.com/subquery-01.html

If that approach seems too difficult, you could create a Totals query that
gives you the average for the day. Then join that to your original table in
another query.
 
B

Bill

I let that method run all night and the query never completely finished. Is
there a faster method?
 
A

Allen Browne

1. Create a query.

2. Depress the Total button on the toolbar.
Access adds a Total row to the design grid.

3. In the total row beneath the Station and date fields, accept Group By.

4. In the Total row beneath the temperature field, choose Average.
 
B

Bill

but that would just average by day, the average happens across days. for
example 1/1 is averaged with 1/2 and 1/2 is averaged with 1/3 and so on.
 
A

Allen Browne

Okay: I have not understood your example.

If an average is calculated across days, you will need to take the time to
learn the subquery approach.
 

Ask a Question

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.

Ask a Question

Top