hojohappy
asked on
SQL Select Command to do a partial match
I need a SQL Select command that can to do a partial match. I need match the first a NBR to the first 10 digits of another number. For example:
ItemID= 10 digits long
EAN11 = 11 digits long.
I need to match STEPUPC.ItemID to the first 10 digits of the SAPMATUPC.EAN11.
SELECT *
FROM STEPUPC
WHERE NOT EXISTS
(SELECT SAPMATUPC.EAN11
FROM SAPMATUPC WHERE STEPUPC.ItemID = SAPMATUPC.EAN11
ItemID= 10 digits long
EAN11 = 11 digits long.
I need to match STEPUPC.ItemID to the first 10 digits of the SAPMATUPC.EAN11.
SELECT *
FROM STEPUPC
WHERE NOT EXISTS
(SELECT SAPMATUPC.EAN11
FROM SAPMATUPC WHERE STEPUPC.ItemID = SAPMATUPC.EAN11
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
FROM STEPUPC
WHERE NOT EXISTS
(SELECT SAPMATUPC.EAN11
FROM SAPMATUPC WHERE STEPUPC.ItemID = LEFT(SAPMATUPC.EAN11 ,10) )