I confirmed that the columns in the SQL table contain the results I’m searching for (the results being NA), but when I use the query below, no results are returned. Could I get some help with this please?
SELECT DISTINCT * FROM [DB_NAME].[dbo].[TABLE_NAME] WHERE BECDescription like '%Time Warner%' AND (CONCAT(PhysicalAddress1, PhysicalCity, PhysicalStateProvince) like ('%NA% %NA% %NA%') ) AND PhysicalCountry like '%NA%' AND CarrierName like '%NA%' AND CurrNetChargeAmt = 1326.00
Advertisement
Answer
You concat PhysicalAddress1, PhysicalCity, PhysicalStateProvince but you add spaces between the ‘%NA’.
Try
SELECT DISTINCT * FROM [db_name].[dbo].[table_name] WHERE BECDescription like '%Time Warner%' AND (CONCAT(PhysicalAddress1, ' ', PhysicalCity, ' ', PhysicalStateProvince) like ('%NA% %NA% %NA%')) AND PhysicalCountry like '%NA%' AND CarrierName like '%NA%' AND CurrNetChargeAmt = 1326.00