• fparker 20089 - Thursday, December 21, 2017 9:31 AM

    This is not working with the % but it does work without it. 

    SELECT   ,[Name]  ,[Address]  ,[Address2]  ,c.[City]  ,r.[city_name]  ,[State]  ,[ZipCode]  ,[TerritoryCode]  ,[CountryCode]
    FROM [Customer] c
    left join [xRefCityNames] r ON c.Address2 = r.[city_name]
    where c.city = '' and address2 = 'new delhi'

    This works but when I use   ON c.Address2 = '%' + r.[city_name] + '%' 
    I get NULL for city_name. 

    Thoughts?

    Yes, it should be LIKE not =
     ON c.Address2 LIKE '%' + r.[city_name] + '%' 

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA