﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Reporting Services / Reporting Services 2005 Development  / Records repeat for SSRS 2005 report / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 16:29:19 GMT</lastBuildDate><ttl>20</ttl><item><title>Records repeat for SSRS 2005 report</title><link>http://www.sqlservercentral.com/Forums/Topic1423777-1063-1.aspx</link><description>When I run a report for a purchase order, the report duplicates records for product codes.For example the purchase order is: P000976, the report display the product code twice when it should only appear once. 45-5540 appears twice.P000976                  09-17-2012                  15,040.00      15,040.00            0.00                        45-5540         "Lordotic Cervical Spacer 10mmLordotic Cervical Spacer 10mm"                        20      20            0                        45-5540         "Lordotic Cervical Spacer 10mmLordotic Cervical Spacer 10mm"                        20      20            0      When I put the report's SQL in SQL server and run the sql by seeing where the code cause the additional product code it is this line within the SQL:join all_product_codes_VW p on q.distpartno = p.distpartnoselect q.specialrequirement, q.distpartno, q.toproduce, q.prodbegindate, q.distributor, rc.report_category_name, s.productperpo, r.ebi_released, w.ebi_in_WIP, p.distproductname, tp.typeprefixdetail, tp.cost, '1' as ReportTotalsfrom all_required_vw qleft join all_shipped_grafts_new_VW s on (q.distpartno = s.distpartno and q.specialrequirement = s.ponumber)left join all_released_Grafts_VW r on q.distpartno = r.distpartnoleft join all_in_WIP_VW w on q.distpartno = w.distpartnojoin all_product_codes_VW p on q.distpartno = p.distpartnojoin setup_tissue_prefix tp on q.typenumber = tp.typeprefixjoin setup_report_category_1 rc on q.distributor = rc.report_category_idwhere q.prodbegindate &amp;lt; @enddate           and q.completed = '0'            and rc.report_category_name  like  '%' + isnull(@tcustomer, '') + '%'order by q.prodbegindate, p.distproductnameThis is the SQL for the view for which the join creates the duplicate.SELECT        COUNT_BIG(*) AS BIG, DistPartNo, DistProductName, Distributor, UMTBProductCodeFROM            dbo.Setup_Distributor_Product_infoWHERE        (Distributor &amp;lt;&amp;gt; '7') OR                         (Distributor IS NULL)GROUP BY DistPartNo, DistProductName, Distributor, USSAProductCode</description><pubDate>Mon, 25 Feb 2013 14:26:07 GMT</pubDate><dc:creator>LastJedi</dc:creator></item></channel></rss>