Compare query with table. Output based on portion of field of table.

C

cerell

I have a query that contains 1 field and a table with 2 fields. See
below:

Query

PN

AR33
WE22
AR45
QW32
AR46

Table

Prefix Location

AR Front Shelf
WE Rear Shelf
QW Upstairs

Resulting query I am looking for:

PN Location

AR33 Front Shelf
AR45 Front Shelf
WE22 Rear Shelf
QW32 Upstairs
AR46 Front Shelf

I am using Access 2003. I'm not sure how to implement this proceedure.
Any insight would be helpful. Thanks.
 
4

415spenn

It sounds like your query concatenates location with some type of
identifier.

One approach would be to take only the left-most two characters
(Left([YourField],2) and join that to your lookup table of locations,
returning both the full (concatenated) field and the Location.

Consider posting the SQL statement of that query ... perhaps you can use
THAT query to return the information with suitable modification.

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/




I have a query that contains 1 field and a table with 2 fields. See
below:




Prefix          Location
AR             Front Shelf
WE            Rear Shelf
QW            Upstairs
Resulting query I am looking for:
PN            Location
AR33        Front Shelf
AR45        Front Shelf
WE22       Rear Shelf
QW32       Upstairs
AR46        Front Shelf
I am using Access 2003. I'm not sure how to implement this proceedure.
Any insight would be helpful. Thanks.- Hide quoted text -

- Show quoted text -

Jeff,

The (Left([YourField],2) Did it. Thank you for your help.
 
J

Jeff Boyce

It sounds like your query concatenates location with some type of
identifier.

One approach would be to take only the left-most two characters
(Left([YourField],2) and join that to your lookup table of locations,
returning both the full (concatenated) field and the Location.

Consider posting the SQL statement of that query ... perhaps you can use
THAT query to return the information with suitable modification.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top