Help with High School grades
Hi everyone, This is my first post at vbforums so I hope I am doing so properly. I a high school teacher and am constructing a simple database to house my students scores assignment scores and have run into a small problem. As the grading period progresses I manually add more fields to the "t_assignments" table and then modify a query that calculates the average of all the fields in the record. An example of the table is here
http://mrgriggs.com/help/assignments.pdf
The assignment for tomorrow will be called W4_A2 and will be added manually to the table. Then I will manually modify the query that pulls the information from the table so that the new field is included in the average. I basically add up the assignments and divide by the number of assignments. So if there were 3 assignments my code would be ...(A1 + A2 + A3)/3....after I add the new assignment I change it to (A1 + A2 + A3 + A4)/4. My question is how can a work around having to manually adjust the query that calculates the average?
Thanks
Re: Help with High School grades
Welcome to the forums. :wave:
Ever use SQL?
I suspect a function in SQL called AVG (Average) would do the trick for you.
http://www.w3schools.com/SQL/sql_func_avg.asp
Re: Help with High School grades
Quote:
Originally Posted by
Hack
Thanks for the response
I have some experience with SQL and the AVG function but I do not know how to add the new fields on the fly so that I would not have to manually add it to the query every time I add a new field.
Re: Help with High School grades
Read up on normalization, table design is wrong hence everything from front end to backend is difficult to maintain. You have the wrong mindset; this is a database table not an excel worksheet.