I currently have a database that records my tenpin bowling scores. A while ago I got some help to add various statistics to it, but I am now looking at adding a running average to my report.
Attached is an image of the report in question. You will see that 3rd column in from the left is average. This is made up of the total of the 3 games / 3. Easy!
However, what I would like to do is a running average. So, the first week the running average would obviously be 185. The next week it would be 177.6 (the 6 games added together / 6, or the 2 averages added together / 2)
The following weeks would be 183.66 and then 194.58.
I have been trying to do this for ages but am failing miserably. Can anyone help please?
The attached database may help you solve your problem.
The table tbl_score contains three fields to hold your weekly game scores.
After entering the weekly scores you will need to run the module mod_calc_prog_avg by putting this line of code calc_prog_average after you save the the weekly scores.
The module stores the running totals for each game for all the rounds then determines the average for all games and stores the average in the last record.
Thank you very much for your prompt reply. I have had a go at putting in the module into my database. Unfortunately I keep getting a compile error (and to be honest, I have no idea what that means. Sorry)
I have attached a live version of my database with the module in it, and the code changed to 'hopefully' reflect the correct references in the module.
I wondered if you'd mind having a look at this for me and seeing where I am going wrong?