Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Find Duplicate Data Post Reply Post New Topic
Author Message
DaBoujibo
Newbie
Newbie


Joined: 21 Feb 2012
Online Status: Offline
Posts: 28
Quote DaBoujibo Replybullet Topic: Find Duplicate Data
     Posted: 13 Dec 2012 at 12:21pm
Hi. I tried to search for this topic, but received results for those who have duplicate data and want to fix it.  I have the opposite question. 
 
I have a table of data.  I need to find out if certain fields have duplicate data and display the duplicates.  Duplicates could be in the fields: Full Address, SSN, Phone #, and Last Name.
 
Example:
 
Tables: "Tenant Info" & "Owner Info"
 
Fields in both tables:
     Subsidy
     First Name
     Last Name
     Street Address
     City
     State
     Zip
     Phone
     SSN
 
I am having trouble figuring out the selection criteria to use to pull only duplicates.  Also, is there a way to have this all in 1 report?  Or would I need 1 report for duplicate addresses, 1 report for phone #s, etc.?
 
I'm running CR 2011. Any help would be greatly appreciated.  Thanks in advance!
 
Sincerely,
Christy
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Dec 2012 at 7:29am
my stock answer is to use a stored procedure, since you have more flexability and probably bring it out as 1 report.
 
if you can't make/use stored procedures, you can try a command object.
the sql would use the ideas of 'group by' and 'having'.
 
You can use the Having clause to ensure that the count(*) > 1.
 
If all of this is foreign to you, it might be a path to google and find out more.
 
last idea, if you can Group your report so that duplicates would display in the same group, you could use the count to determine if there are duplicates or not...but this will only work if the rows of detail are in a 1 to 1 relationship to the grouping criteria.
 
for example, if you were looking at names vs social security numbers and you grouped by names, you could see if there are 'duplicate' socials, but if you grouped by names, social and check number, it would be harder as 1 person might have multiple checks in a time range (or none) ...once you add another piece of data to be displayed in the report, this method starts running into difficulties
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum