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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft 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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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".
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.