I have the following within my SELECT statement;
ISNULL(CASE WHEN LEFT(EMISJun15Btch1.dbo.Problem.ReadCode, 5) = 'PCSDT' THEN 'PCSDT' WHEN LEFT(EMISJun15Btch1.dbo.Problem.ReadCode, 7) = 'EMISATT' THEN 'EMISATT' ELSE EMISJun15Btch1.dbo.Problem.ReadCode END, N'(novalue)') COLLATE SQL_Latin1_General_CP1_CS_AS = ISNULL(dbo.CPRDLkupMedical.Readcode, N'(novalue)') COLLATE SQL_Latin1_General_CP1_CS_AS
N/B: EMISJun15Btch1.dbo.Problem.ReadCode field the Collation SQL_Latin1_General_CP1_CS_AS
dbo.CPRDLkupMedical.Readcode field the Collation SQL_Latin1_General_CP1_CS_AS
The issue is in EMISJun15Btch1.dbo.Problem.ReadCode
I have the following codes;
and dbo.CPRDLkupMedical.Readcode (only one record)
So, it pulls all records with ONLY 13IQ and neglect all records with 13LQ.
I want it to compare between the two tables and see 13IQ AND 13LQ as similar record. Therefore, pull all records with readcode 13LQ too.
Any ideas please.. Thanks