sql - MS Access 2003: Check if data is within range from another table -


i have 2 tables, table hours, , table b have grade, , minimum hour required

what i'm trying assign tableb.grade tablea depending on how hours each record has.

example:

tablea

name        hours        person     205 person b     105 person c     400 

table b

grade       hoursrequired 1              0 2              100 3              200 4              300 

my expected report

name      hours     grade person    105     2 person b    205     3 person c    400     4 

any advise on sql coding or restructuring of table appreciated.

i @andomar's suggestion. however, if subqueries confuse you, revise tableb this:

grade low_end   high_end 1           0         99 2         100        199 3         200        299 4         300 2147483647 

then use query:

select a.person_name, a.hours, b.grade tablea a, tableb b (((a.hours) between [b].[low_end] , [b].[high_end])) order a.person_name; 

name reserved word re-named name field person_name.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -