Averaging Data Rows in Access

Averaging Data Rows in Access

am 05.12.2007 17:35:45 von JJ R

I am trying to develop a simple and efficient to calculate averages. For
example I want to calculate the averages of the Values for rows 1 and 2
and use ID 1 as the row with the average result.

Table Exmple
ID Value1 Value2 Value3
1 2 3 1
2 5 4 32
3 4 45 6
4 12 78 12

I can set up the Function to call the recordset, but I"m at a loss. It's
been over two years since I've had to write code. Any help would be
greatly appreciated.

THanks,J.




*** Sent via Developersdex http://www.developersdex.com ***

Re: Averaging Data Rows in Access

am 05.12.2007 20:53:40 von Davidb

On Dec 5, 11:35 am, JJ R wrote:
> I am trying to develop a simple and efficient to calculate averages. For
> example I want to calculate the averages of the Values for rows 1 and 2
> and use ID 1 as the row with the average result.
>
> Table Exmple
> ID Value1 Value2 Value3
> 1 2 3 1
> 2 5 4 32
> 3 4 45 6
> 4 12 78 12
>
> I can set up the Function to call the recordset, but I"m at a loss. It's
> been over two years since I've had to write code. Any help would be
> greatly appreciated.
>
> THanks,J.
>
> *** Sent via Developersdexhttp://www.developersdex.com***

Not sure waht exactly you want averaged. In averaging
'rows' (records) 1 and 2 do you want the result to be...


a) 3.5, 3.5,16.5 (the average of 2 and 5, the average of 3 and 4, the
average of 1 and 32)
b) 2, 17 (the average of 2, 3, and 1 :: the average of 5, 4, and 32)
c) 7.8333333 (the average of 2, 3, 1, 5, 4, and 32)