secureshell
Programmer
Hi,
I have a table with the following fields & values:
ID Weight
1 10
1 15
1 20
2 18
2 22
2 25
I need to display the progressive average of the 'Weight' field for each record grouped by ID, e.g;
ID Weight Avg
1 10 10.0 -> (10/1)
1 15 12.5 -> [(10+15)/2]
1 20 15.0 -> [(10+15+20)/3]
2 18 18.0 -> (18/1)
2 22 20.0 -> [(18+22)/2]
2 25 18.33 -> [(18+22+25)/3]
The Avg colum is the new colum that needs to be created and that will display the progressive 'Weight' averages. Any help would be great. I have considered alternatives already for this issue but doing it through SQL is much much clean. I am using Access 2000 and queriying from VB. Thx {W r i t e C o d e A n d K i c k A s s}
I have a table with the following fields & values:
ID Weight
1 10
1 15
1 20
2 18
2 22
2 25
I need to display the progressive average of the 'Weight' field for each record grouped by ID, e.g;
ID Weight Avg
1 10 10.0 -> (10/1)
1 15 12.5 -> [(10+15)/2]
1 20 15.0 -> [(10+15+20)/3]
2 18 18.0 -> (18/1)
2 22 20.0 -> [(18+22)/2]
2 25 18.33 -> [(18+22+25)/3]
The Avg colum is the new colum that needs to be created and that will display the progressive 'Weight' averages. Any help would be great. I have considered alternatives already for this issue but doing it through SQL is much much clean. I am using Access 2000 and queriying from VB. Thx {W r i t e C o d e A n d K i c k A s s}