Solved

Display only duplicate records in Report Builder 3.0 Report

Posted on 2014-02-05
2
1,393 Views
Last Modified: 2014-02-07
I'm trying to create a report in Report Builder 3.0 that displays only those records that have duplicates for a field's value.  My data source is a model.  Some records are duplicated twice, some up to four times and then the rest are unique.  I want to hide or filter out the unique records and only display records if there is at least one other record in the dataset with the same value.  Any suggestions?  

Thank you,
0
Comment
Question by:jaisy99
2 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 500 total points
Comment Utility
The way you do this is by using grouping with the having clause. Take for example this situation: you have a table with a few columns: Column1, Column2, Column3, Column4. If you are interested in checking for duplicates against Column2 and Column3 you would write a SQL Statement grouping by those two columns only, like this:
SELECT Column2, Column3
FROM Table1
GROUP BY Column2, Column3
HAVING COUNT(*) > 1

Open in new window

If you need to check all columns the SQL statement will look like this:
SELECT Column1, Column2, Column3, Column4
FROM Table1
GROUP BY Column1, Column2, Column3, Column4
HAVING COUNT(*) > 1

Open in new window

The important thing here is to have HAVING COUNT(*) > 1 clause. It allows to select only those records that have the duplications (more than one duplicate records)
0
 
LVL 1

Author Closing Comment

by:jaisy99
Comment Utility
Thank you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to increase the row limit in Jasper Server.
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now