Solved

# Query Formula - Awarding Grades

Posted on 2003-03-10
Medium Priority
372 Views
Well, my question is an important one but it should be easy for some to answer with advanced experience of MS Access:

The general aim of my case study is to produce a database which manages the re-marking of examination scripts.

I have two tables; One with candidate and the other with subject information (which includes grade boundaries).

With a query, I would like to link these tables so that I can produce a number of results that the case study requires of me.

---

What formula would you suggest I use if I wanted a field to produce the "grade" (e.g. A,B,C) using the information of "mark" and "maxmark"?

Thank you for reading my question. :-)
0
Question by:Kouga
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 41

Expert Comment

ID: 8102554
What is the structure of your tables ?
0

LVL 1

Expert Comment

ID: 8102620
Fieldnames would be nice at least. But Just make a query and add tyge to tables and make a link between the equal fields. (pull the id field over to the eqiuvalent in the other table) Then add your selected  output fields.(doubleclick)

// j
0

LVL 2

Accepted Solution

Hummusx earned 200 total points
ID: 8102772
SELECT Candidate.Name, Subject.Name, IIF(Subject.Mark > 89, 'A', IIF(Subject.Mark > 79, 'B', IIF(Subject.Mark > 69, 'C', IIF(Subject.Mark > 59, 'D', 'F') AS Grade FROM Candidate JOIN Subject on Candidate.ID = Subject.CandidateID

This will return results like:

Joe  Math     A
Joe  English  B
Joe  History  A

Assumptions in the query above are:

Candidate is the name of the candidate table
Subject is the name of the subject table

Name, ID is a field in Candidate table
Name, Mark, CandidateID are fields in Subject table

Tables are related by the ID fields

0

Author Comment

ID: 8110440
The field names are:

candidate table: TBL1-CANDIDATE DETAILS

candidate_no
candidate_surname
candidate_forename
centre_no
sub_ref_no
original_mark
remark_mark
request
date

subject table: TBL2-SUBJECT DETAILS

sub_ref_no
sub_name
maxmark
a
b
c
d
e

----

I want to produce a double IF statement to calculate the students grade in a query. Is this is enough information for you to help? :)
0

LVL 1

Expert Comment

ID: 8111327
For show all cases:
SELECT candidate.candidate, subjectinfo.subject
FROM candidate, subjectinfo;

For number of cases:
SELECT Count(*)
FROM candidate, subjectinfo;

Hope can help..
0

Author Comment

ID: 8118677
Well, I fixed it myself. I worked at the 'percentage' first and used the statement:

0

LVL 2

Expert Comment

ID: 8118774
Isn't that basically exactly what I posted?
0

LVL 12

Expert Comment

ID: 8785466
Hi Kouga,
This question has been abandoned and needs to be finalized (103 days since last comment).

You can accept an answer, split the points, or get a refund. Go to
http://www.cityofangels.com/Experts/Closing.htm for information and options.

nexusnation
EE Cleanup Volunteer for Microsoft Access
0

LVL 18

Expert Comment

ID: 8888275
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to Hummusx

1William
EE Cleanup Volunteer
0

## Featured Post

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all recordâ€¦
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filledâ€¦
###### Suggested Courses
Course of the Month13 days, 10 hours left to enroll