Student grades, converting numerical to letter grade

A

Alan in Canterbury

We have a dual system of grading in the UK. Both letters and corresponding
numerical values are used. They may be input as numerical ie 55% but may then
be issued as letter grades or vice versa. I have calcultaed weighted averages
using a query and thought the logical operator "between" might work but no
success yet. Help please.
 
A

Allen Browne

Assuming a numeric field named "Marks", you should be able to lookup the
corresponding grade letter by entering a calculated field like this:
=DLookup("Grade", "GradeTable", "Marks >= " & Nz([Marks],0))

DLookup() is slow if you are trying to do this on every row of a query. If
you don't mind a read-only result (e.g. for a report), you can use a
subquery to get the grade. Type something like this into the Field row in
query design view:
GradeLetter: ( SELECT First(Grade) FROM GradeTable
WHERE StudentResults.Marks >= GradeTable.Marks )

The example assumes that the student marks are contained in a table called
StudentResults.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Top