?
Solved

Calculating GPA in Access 2010

Posted on 2012-08-24
1
Medium Priority
?
2,302 Views
Last Modified: 2012-08-24
Can you help me create a query that calculates current overall GPA?

The database is for only one student.  It contains two tables (screenshot attached)

tables
(GPA is calculated by dividing the total amount of grade points earned by the total amount of credit hours attempted. Grade point average may range from 0.0 to a 4.0. An A earns 4 points, a B earns 3, a C= 2, a D 1 and an F 0.  A W earns no points but indicates that the semester hours for that course should not be counted in the hours attempted total.)

This is my scratch work so far...but I don't know what else to do with it or what else to try...

[[[ SUM DegreeRequirements.SemesterHours where CompletedCourses.Grade <> W AND  DegreeRequirements.CourseCode = CompletedCourses.CourseCode

SUM GradePoints,

GradePoints:  [CreditHours] * Nz(Switch([LetterGrade] = "A", 4, [LetterGrade] = "B",
3, [LetterGrade] = "C", 2, [LetterGrade] = "D", 1, [LetterGrade] = "F", 0),
0)

GPA: SUM GradePoins / SUM DegreeRequirements.SemesterHours ]]]

(I love Access, I don't know why I always get so tangled up with it :-( )
0
Comment
Question by:fabi2004
1 Comment
 
LVL 1

Accepted Solution

by:
fabi2004 earned 0 total points
ID: 38331150
I figured it out.

SELECT Sum([tblDegreeRequirements].[SemesterHours]*Nz(Switch([tblCompletedCourses].[Grade]="A",4,[tblCompletedCourses].[Grade]="B",3,[tblCompletedCourses].[Grade]="C",2,[tblCompletedCourses].[Grade]="D",1,[tblCompletedCourses].[Grade]="F",0,[tblCompletedCourses].[Grade]="W",0),0)) AS GradePoints, Sum(tblDegreeRequirements.SemesterHours) AS Credits, [GradePoints]/Credits AS GPA
FROM tblDegreeRequirements INNER JOIN tblCompletedCourses ON tblDegreeRequirements.CourseCode = tblCompletedCourses.CourseCode
HAVING (([tblCompletedCourses].[Grade]<>"W"));


Then I adjust the properties of the GPA field to Format=fixed and Decimal=2
I get a couple of sums I hadn't thought about showing, but it doesn't hurt for them to show up.  So I'm all good.  

Thanks anyways.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question