Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set value in query based on data in unrelated table

Status
Not open for further replies.

dtay1132

IS-IT--Management
Nov 5, 2002
33
0
0
US
It has been a while since I did any serious work with queries and then of course my machine was upgraded to MS Access 2007 so there is probably some newer way to do what I need to accomplish.

I have two tables, and need to use the value in Table A to return a value from table B to a query that has other information from Table A.
In table A there is a field with a text string called Code. It is a 5 digit text field (text because the leading character can be alpha or numeric). There are other fields in this table, but Code is the one that needs to be used to pull the value from Table B.

Table B has 3 fields in it StartCode, EndCode and Category. There are 10 records in this table that have different categories for each of the StartCode / EndCode ranges. I need to use the value in TableA.Code to check whether it falls within the range of TableB.StartCode and TableB.EndCode to return TableB.Category to my query.

How can I return the Category from Table B to a query that has the data from Table A in it?

Appreciate the help.

 
Read only should be ok. I need to export the results to excel to do some pivot stuff that is beyond what I can do in access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top