'SQL Join tables - join with last four digits of columns

I'm trying to join two tables in SQL. I want to join on the column with the last four digits of a phone number with the a column from a second column where only the last four digits are shown.

From ExcelSheet1 E
Join Walkers W
ON W.Lastname = E.LNAME
AND W.Firstname = E.FNAME
and W.PhoneNum like '%'+E.MEMBER_NUM


Solution 1:[1]

From ExcelSheet1 E
Join Walkers W
ON W.Lastname = E.LNAME
AND W.Firstname = E.FNAME
and W.CardNum like '%'+ cast(E.MEMBER_NUM as varchar)

after casting the variable MEMBER_NUM as a varchar i got the result i was looking for

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anna Elfstrum