between max and min of a table

crossy5575

Registered User.
Local time
Today, 19:21
Joined
Apr 21, 2015
Messages
46
Hi all

i have a table with player id, name and grade

i have table2 with id, group, max, min
where grade is a,b,c,d and the max min corresponds with the boundaries of that grade.

how do i make a query that does the equivalent of a match excel function to work out how each student can be graded?

thanks
Simon
 
Something seems to be missing. Are grades in the first table letters or numbers? What's group in the second table? You probably don't need both min and max in the second table if the grades are discrete ranges. Some sample data with an expected output would help us.
 
please see attached database;

from the first table student 1 got 92 in their Maths exam, from table2 this would be between 100 and 80 thus need to return a grade "A"
 

Attachments

Your query should look like this:

Code:
SELECT table1.ID, table1.student, table1.mark, table1.Subject, Table2.Grade
FROM table1, Table2
WHERE table1.mark Between [table2].[min] And [table2].[max];

Note how there is no join in the query. This is called a Cartesian Product and the criteria ensures only the relevant records are selected (because the Cartesian Product produces lots of records that are not relevant).
 
Last edited:

Users who are viewing this thread

Back
Top Bottom