You probably won't even need this many case statements,but the code is easy to read and will be easier to maintainSELECT t1.DealID,t1.RefNos,t1.PapaID,[MethodUsed] = CASE WHEN t2.dealid Is not null and t2.type is not null THEN 'Y' WHEN t2.dealid is null and t2.type not in (27,42,55) THEN 'Y' WHEN t1.papaid is null and t2.type not nn (27,42,55) THEN 'Y' ELSE 'N' ENDFROM table1 t1LEFT JOIN table2 t2 on t1.dealid = t2.dealid
JimEveryday I learn something that somebody else already knew