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!

Help w/ Query

Status
Not open for further replies.

eyal8r

Technical User
Sep 4, 2007
43
0
0
US
Hey guys-
I have 2 tables- and need to find the record matches between them via their product code. Table 1 has the code as follows (and is considered 'the Master List')-
xxx-xx-xxx Where x is an integer.

Table 2 has split the 3 sections of the code out to 3 individual fields, like this-
Field1 Field2 Field3
xxx xx xxx

I need a query that will combine the 3 fields in table 2 to the same format as Table1 so that I can find the matches between them. I know this is a basic question, but I'm a learning newbie. How would I write that in a query? I don't think I want to write the format to the table- just include it in the query somehow...
Thanks!
 
Perhaps something like this (SQL code) ?
SELECT *
FROM Table1, Table2
WHERE Table2.Field1 & '-' & Table2.Field2 & '-' & Table2.Field3 = Table1.[product code]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you! Now- if I am going to find the MATCH in the 'master list (Table1), and take a field from Table1 of the matching records and insert it into a specific field in Table2- how do I do that?

ie-
Of the ones that match (as stated above), take Table1.Name and insert it into Table2.Name

Can you help?
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top