What am I doing wrong? I am tearing my hair out here!
I have two tables from different servers, linked by an ID field. basically in one server the a colour is recorded properly (white, black etc.) however in the second the colour is recorded with a description (White - Vic Window, Rose - Vic Open In Door) My task is to produce a query that will return those records where the colours don't match.
I have produced the following:
SELECT a.orderid,
a.colour AS LoggedColor,
b.groupdesc AS [Processed Color]
FROM [Server].[DB].[dbo].[frames] AS b
INNER JOIN tblorder AS a
ON a.orderid = b.header_id
WHERE b.colour NOT LIKE '%' + a.colour + '%'
However the like statement does not appear to be working as it is returning the following:
Logged Colour = White
Processed Colour = White - Vic Window
a further look shows that it is in fact returning all records.
FYI I cannot change the database structure - I have had many heated discussions with the creator about what I think of it.
Thanks in advance