SSRS: Collapse the Data, Please


Please review the attached SQL Reporting Services (SSRS) report.  It is displaying duplicate vendor IDs for the "Released" column.  

I want one row per vendor in this report.  

I don't know how to fix this.  I just know that it has something to do with the "Released" field, and I don't know if that's the fault of the query in my dataset or if that's a fault of how I configure SSRS.

Please help.


Who is Participating?
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
Eyeballeth thy 'POOR_Subreport'.  Copy the T-SQL, paste into SSMS, and execute it, and verify that the return set does not have duplicate Vendor ID's.

UNION ALL will include duplicate rows if both top and bottom SELECT clauses have them.

UNION ALL all should only be used if it is a certainty both top and bottom do not have duplicates.
SELECT name FROM whorehouses UNION ALL SELECT name FROM burgerjoints

Open in new window

To eliminate duplicates, use UNION instead.

>I want one row per vendor in this report.  
Also, I don't see any GROUP BY in either parts of the query, which would imply that the return set is grouped by vendor, to ensure that only one row per vendor is returned.
TBSupportAuthor Commented:
Hi Jim:

I had already tried removing the "ALL".  That did not solve the problem.

There is, in fact, a "Group By" clause for each of the three parts of this UNION ALL query.

You mentioned the name "POOR_Subreport".  The name of the subreport in this case is "POOR_RCG_Subreport.  Are you reviewing the attachment for this case?  That's the one that I'm having issues with.


Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Correct, looks like I was looking at an .rdl from an earlier question of yours.  Please disregard.
TBSupportAuthor Commented:
Thanks, Jim!  I just found out that I don't need to put in "Released".
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.