Hello experts I am constructing a view and I am having problem in my where statement as I am tryin to use a wildcard in it.
when I dont use my where statements I am getting results but like 15 with ID 1 and 15 with ID 2... its not so much fun so I have a field in table A called Last4onCC and table B called CCLastNum. What i AM TRYING to do is have the a.Last4onCC that has a value of 2367 be matched up with the record from b.CCLastNum value of 47********2367 but its not working as expected... I get Zero results... can someone tell me what I am doing wrong please?
TOP (100) PERCENT A.id, A.FName, A.LName, A.ParkID, A.Email, A.Address, A.City, A.State, A.Zip, A.PhoneNumber, A.Last4onCC, A.TodaysDate,
A.PaymentSucces, B.GUID, B.PaymentType, B.Partial, B.Amount, B.DateEntered, B.IP, B.Successful, B.TransNumber, B.Printed, B.ValidateID, B.Expire,
B.PayAmount, B.PaidTime, B.NOVAguid, B.CCLastNum, B.FlowupGUID, A.PaymentType AS Expr1
FROM dbo.tbl_info AS A INNER JOIN
Wdb_CCPayment.dbo.tblPayment AS B ON A.PaymentType = B.PaymentType
WHERE (A.Last4onCC LIKE B.CCLastNum)
ORDER BY B.PaidTime DESC