?
Solved

Query Formula - Awarding Grades

Posted on 2003-03-10
10
Medium Priority
?
372 Views
Last Modified: 2006-11-17
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
Comment
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
  • Learn & ask questions
10 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8102554
What is the structure of your tables ?
0
 
LVL 1

Expert Comment

by:njelger
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

by:
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


Of course you can fill in your own table/field names instead.
0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

Author Comment

by:Kouga
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

by:annine
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

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

new grade: IIf([percentage]>=[a],"A",IIf([percentage]>=[b],"B",IIf([percentage]>=[c],"C",IIf([percentage]>=[d],"D",IIf([percentage]>=[e],"E",IIf([percentage]<[e],"U"))))))

0
 
LVL 2

Expert Comment

by:Hummusx
ID: 8118774
Isn't that basically exactly what I posted?
0
 
LVL 12

Expert Comment

by:nexusnation
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

nexusnation
EE Cleanup Volunteer for Microsoft Access
0
 
LVL 18

Expert Comment

by:1William
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
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

801 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