OK - so what you want to do is to lookup the lettergrade from the gradestructure based on the grade percentage?
There are a few ways
Rather than an iif statement, you can use a subquery
Code:
SELECT *, (SELECT top 1 lettergrade from gradestructure where grademax>maintable.gradepercentage order by gradepercentage desc) as lettergrade
FROM maintable
or you can use a Cartesian query (no join)
Code:
SELECT maintable.*,lettergrade
FROM maintable, gradestructure
WHERE maintable.gradepercentage between gradestructure.grademin and gradestructure.grademax
or you can use a join - note the two above can viewed in the query gui, but with this join, you can only view in the sql window
Code:
SELECT maintable.*,lettergrade
FROM maintable inner join gradestructure ON maintable.gradepercentage between gradestructure.grademin and gradestructure.grademax