I am using the following select but i get multiple records with the same tiffile field, i am using distinct but its still gets multiple records.field tiffile is a text field.SELECT DISTINCT C.Tiffile, C.id, D.ProgNO, E.ProjNO, F.ContractNO, A.RMID, A.SequenceNO, case when @LocLang = 'English' then L.EnglishText when @LocLang = 'Spanish' then L.SpanishText when @LocLang = 'Catalan' then L.CatalanText end as EnglishText,A.Deleted FROM TablePM AS A JOIN TABUserAccess AS B ON (A.ProgID = B.ProgID and A.ProjID = B.ProjID and A.ContractID = B.ContractID and B.Userid = @Userid AND B.Module = 'PM') INNER JOIN TAB_Programs D ON A.ProgID = D.ProgID INNER JOIN TAB_Projects E ON A.ProjID = E.ProjID INNER JOIN TAB_Contracts F ON A.ContractID = F.ContractID INNER JOIN TAB_PickLists L on (A.Logtypeid = L.PickID and L.FieldLabelKey = 'lblLogType') JOIN #TEMPFINDOCR AS C ON (A.RMID = C.type_id) WHERE A.Deleted = 0 Drop table #TEMPFINDOCR
Thank you very much for the help.