|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Pull if matches 2nd to end of text fieldI have 2 tables in a database. Table 1 has a field (1a) that contains a
customer part number. It also has a field (1b) that contains just a manufacturer part number. Table 2 contains 2 fields. Field (2a) has the description that might have a word or many words then the manufacturer part number and then a manufacturer. Field (2b) would have only have an internal number. I am trying to match up the customer part number from table 1 to the internal part number of table 2. Is there any way to do this? The other task that I will need to do is pull the manufactuer and the manufacturer part number out into seperate fields. Thanks for your help in advance Dan
Show quote
On Thu, 16 Feb 2006 21:35:38 -0500, "Dan" <danre***@yahoo.com> wrote: Are you familiar with SQL at all? This would be done with a JOIN:>I have 2 tables in a database. Table 1 has a field (1a) that contains a >customer part number. It also has a field (1b) that contains just a >manufacturer part number. > >Table 2 contains 2 fields. Field (2a) has the description that might have a >word or many words then the manufacturer part number and then a >manufacturer. Field (2b) would have only have an internal number. > >I am trying to match up the customer part number from table 1 to the >internal part number of table 2. Is there any way to do this? >The other task that I will need to do is pull the manufactuer and the >manufacturer part number out into seperate fields. > >Thanks for your help in advance >Dan >I am trying to match up the customer part number from table 1 to the >internal part number of table 2. Is there any way to do this? SELECT * FROM Tbl1 as T1 JOIN Tbl2 as T2 ON T1.CustPartNbr = T2.InternalNumber >The other task that I will need to do is pull the manufactuer and the Look up the SUBSTRING and CHARINDEX.>manufacturer part number out into seperate fields. Roy Why yes Roy I do know some about SQL. I understand that if the fields were
equal then this would work great. My problem is that table 1 field (1a) manufacturer part number will match the just a part of table 2 field (2a) part description. the "=" will not work Show quote "Roy Harvey" <roy_har***@snet.net> wrote in message news:kfgav1dde8i0e2imndpmssg95n04lbavvj@4ax.com... > On Thu, 16 Feb 2006 21:35:38 -0500, "Dan" <danre***@yahoo.com> wrote: > >>I have 2 tables in a database. Table 1 has a field (1a) that contains a >>customer part number. It also has a field (1b) that contains just a >>manufacturer part number. >> >>Table 2 contains 2 fields. Field (2a) has the description that might have >>a >>word or many words then the manufacturer part number and then a >>manufacturer. Field (2b) would have only have an internal number. >> >>I am trying to match up the customer part number from table 1 to the >>internal part number of table 2. Is there any way to do this? >>The other task that I will need to do is pull the manufactuer and the >>manufacturer part number out into seperate fields. >> >>Thanks for your help in advance >>Dan > >>I am trying to match up the customer part number from table 1 to the >>internal part number of table 2. Is there any way to do this? > > Are you familiar with SQL at all? This would be done with a JOIN: > > SELECT * > FROM Tbl1 as T1 > JOIN Tbl2 as T2 > ON T1.CustPartNbr = T2.InternalNumber > >>The other task that I will need to do is pull the manufactuer and the >>manufacturer part number out into seperate fields. > > Look up the SUBSTRING and CHARINDEX. > > Roy I guess I misunderstood the question the first time around. When you
said that "I am trying to match up the customer part number from table 1 to the internal part number of table 2" thought that meant they were matching values. Looking again, I think that you meant to match them up by way of the manufacturer part number. If that is the case, the first thing is to isolate the manufacturer's part number in description field of the second table. Can you post some examples of what this column looks like? It sounds like there isn't much predictability to the position of the manufacturer's part number, so this could get "interesting". Without seeing the data I can only speculate, but I would guess it will require a few passes and some temorary columns or perhaps a work table before we are through. Roy Show quote On Thu, 16 Feb 2006 21:35:38 -0500, "Dan" <danre***@yahoo.com> wrote: >I have 2 tables in a database. Table 1 has a field (1a) that contains a >customer part number. It also has a field (1b) that contains just a >manufacturer part number. > >Table 2 contains 2 fields. Field (2a) has the description that might have a >word or many words then the manufacturer part number and then a >manufacturer. Field (2b) would have only have an internal number. > >I am trying to match up the customer part number from table 1 to the >internal part number of table 2. Is there any way to do this? >The other task that I will need to do is pull the manufactuer and the >manufacturer part number out into seperate fields. > >Thanks for your help in advance >Dan |
|||||||||||||||||||||||