Are both columnA and columnB in the same table?Will give it a try and report back![]()
Do you have to run this script every time or is it a once off thing?
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Are both columnA and columnB in the same table?Will give it a try and report back![]()
Are both columnA and columnB in the same table?
Do you have to run this script every time or is it a once off thing?
WHERE Number LIKE [dbo].[Number.Filter].[NumberCheck]
WHERE EXISTS (SELECT * FROM [Test_Database].dbo.[Number.Filter] as O
WHERE M.PurchaseNumber LIKE CONCAT('%', O.Number))
SELECT TOP 20
[Sales Consultant]
,[Sale Date]
,[ID]
FROM [Sales].[dbo].[TestSales] as S
WHERE S.ID like (SELECT [FilterValue] FROM [Sales].dbo.[TestSales]
WHERE [FilterField] = 'ID')
Ok guys, I'm trying to see if any sales went through on public holidays and such. Test Data below.
http://ifile.it/2ibhtxl
http://ifile.it/spg1fj4
Regarding the problem with Like and checking the value in a different table, it got it to work by adding a '%' in the SQL Table (Hard-coding it, which isn't exactly what I want).
Will add a pic of the Filter Table that I'm using for the below query in a bit.
Code:SELECT TOP 20 [Sales Consultant] ,[Sale Date] ,[ID] FROM [Sales].[dbo].[TestSales] as S WHERE S.ID like (SELECT [FilterValue] FROM [Sales].dbo.[TestSales] WHERE [FilterField] = 'ID')
SELECT TOP 20
[Sales Consultant]
,[Sale Date]
,[ID]
FROM [Sales].[dbo].[TestSales] as S
WHERE S.Date = [Sales].dbo.[Holidays].