|
-
Nov 18th, 2009, 10:46 AM
#1
Thread Starter
New Member
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
-
Nov 18th, 2009, 11:31 AM
#2
Re: Help with High School grades
Welcome to the forums. 
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
-
Nov 18th, 2009, 04:09 PM
#3
Thread Starter
New Member
Re: Help with High School grades
 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.
-
Nov 20th, 2009, 04:25 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|