Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Help with duplicate rows

$
0
0

Hello,

I'm trying to join multiple tables in SSRS report, but I'm not sure how to hide the duplicate rows from the  titer table.

Currently for each row in the tuber table, it's duplicating same row in titer.  How can I hide this?

I'm attaching a sample screen for your perusal. 

Please see the code and let me know your thoughts.

SELECT E.FLDID2, E.FLDLNAME, E.FLDFNAME, TB.FLDDATE AS TBDATE, TB.FLDDATEREAD AS TBREAD, TB.FLDMMREACT, TB.FLDCLASS, IGRA.FLDDATE AS IGRA, IGRA.FLDRESULT, XRAY.FLDDATE AS CXRAY, TBSS.FLDDATE AS TBSS FROM EMPLOYEE E INNER JOIN TEMPLOYEE T ON T.EMPLOYEEID = E.FLDREC_NUM INNER JOIN TEMPLOYEEUSERDATE U ON T.EMPLOYEEID = U.EMPLOYEEID INNER JOIN LOC C ON C.FLDCODE = E.FLDLOC LEFT OUTER JOIN TUBER TB ON TB.FLDEMPLOYEE = E.FLDREC_NUM AND TB.FLDREASON <> 'IG' LEFT OUTER JOIN TITER IGRA ON IGRA.FLDEMPLOYEE = E.FLDREC_NUM AND IGRA.FLDTYPE = 'TBGOLD' LEFT OUTER JOIN PHYSLOG XRAY ON XRAY.FLDEMPLOYEE = E.FLDREC_NUM AND XRAY.FLDTYPE = '109' AND XRAY.FLDDATE = (SELECT MAX(FLDDATE) FROM PHYSLOG XRAY1 WHERE XRAY1.FLDEMPLOYEE = E.FLDREC_NUM AND XRAY1.FLDTYPE = '109') LEFT OUTER JOIN PHYSLOG TBSS ON TBSS.FLDEMPLOYEE = E.FLDREC_NUM AND TBSS.FLDTYPE = 'TBSS' AND TBSS.FLDDATE = (SELECT MAX(FLDDATE) FROM PHYSLOG TBSS1 WHERE TBSS1.FLDEMPLOYEE = E.FLDREC_NUM AND TBSS1.FLDTYPE = 'TBSS') WHERE E.FLDLOC = @major AND U.USERDATE >= @enroll_date AND U.USERDATE <= @enroll_end_date AND U.FIELDINDEX = '0' GROUP BY E.FLDID2, E.FLDLNAME, E.FLDFNAME, TB.FLDDATE, TB.FLDDATEREAD, TB.FLDMMREACT, TB.FLDCLASS, IGRA.FLDDATE, IGRA.FLDRESULT, XRAY.FLDDATE, TBSS.FLDDATE ORDER BY E.FLDLNAME, E.FLDFNAME,E.FLDID2,TB.FLDDATE, TBSS.FLDDATE


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>