Hi all,
I am trying to do a left join comparing two descriptions. It works great however there are several fields that are only a parital match. I have tried using a LIKE statement in the Where field, but it will not return the results I need. I am using the join to compare two Desciption fields. I then put specific criteria in the were field so when the description in table 2 is "Like "EIM *" it will match to table 1 and return the bank label from table 2. This does not work. I can not use partial join queries such as the one shown here because it is not specific enough and matches wrong values.
I can not use Left( ), 3) because there is a different number of values in the descriptions and over 100 of them. I believe it needs to be a like statement to return the correct results. In most cases the first left part of the description in table 1 does match to table 2, but again the amount of values vary for each description. They are all very similar but need very specific labels.
Table 2 DESC TABLE 2 BANK LABEL Table 1 DESC
EIM MC EIM EIM 12897
CMA MC CMA CMA 12
EIM DISC MC EIM DISC EIM DISC 45673
I am using a left join to compare these two fields and return all data from table 1. If TABLE 1 DESC and TABLE 2 DESC match, I need the bank label IN TABLE 2 returned.
This is what I have that does not work:
SELECT [TABLE 1].[DESC], [TBL 2].DESC
FROM [TABLE 1] LEFT JOIN [TBL 2] ON [TABLE 1].[Desc] = [TBL 2].DESC
WHERE ((([TABLE 1].[Desc]) Like "EIM *"));
Any help is greatly appreciated!
I am trying to do a left join comparing two descriptions. It works great however there are several fields that are only a parital match. I have tried using a LIKE statement in the Where field, but it will not return the results I need. I am using the join to compare two Desciption fields. I then put specific criteria in the were field so when the description in table 2 is "Like "EIM *" it will match to table 1 and return the bank label from table 2. This does not work. I can not use partial join queries such as the one shown here because it is not specific enough and matches wrong values.
I can not use Left( ), 3) because there is a different number of values in the descriptions and over 100 of them. I believe it needs to be a like statement to return the correct results. In most cases the first left part of the description in table 1 does match to table 2, but again the amount of values vary for each description. They are all very similar but need very specific labels.
Table 2 DESC TABLE 2 BANK LABEL Table 1 DESC
EIM MC EIM EIM 12897
CMA MC CMA CMA 12
EIM DISC MC EIM DISC EIM DISC 45673
I am using a left join to compare these two fields and return all data from table 1. If TABLE 1 DESC and TABLE 2 DESC match, I need the bank label IN TABLE 2 returned.
This is what I have that does not work:
SELECT [TABLE 1].[DESC], [TBL 2].DESC
FROM [TABLE 1] LEFT JOIN [TBL 2] ON [TABLE 1].[Desc] = [TBL 2].DESC
WHERE ((([TABLE 1].[Desc]) Like "EIM *"));
Any help is greatly appreciated!