Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Duplicate records Post Reply Post New Topic
Author Message
judylynn
Newbie
Newbie
Avatar

Joined: 17 Nov 2008
Location: United States
Online Status: Offline
Posts: 22
Quote judylynn Replybullet Topic: Duplicate records
     Posted: 02 Feb 2010 at 7:39am
I need to find a way to bypass duplicate records in Crystal. I have many duplicates in the database, which is a recurring problem, so if it can be remedied with Crystal it would make my life a lot easier!
 
I need Crystal to bypass records if the date, familyid, and program fields all match.
 
By the way, I don't want to simply "suppress if duplicated" because using this means that Crystal will still read the records and use them in summarries, etc...- it just won't print them. I have several CR reference books but can't find where this problem is addressed.
 
Any help will be greatly appreciated! Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Feb 2010 at 8:22am
you will need to write a stored procedure or a view to the database to do what you want.  Just doing a join to the tables won't work...
 
Well now that I think about it, you could probably accomplish this by setting up a filter in the Report/Selection Formulas/Records.
 
I would probably build a delimited string of the records that have gone before, and omit the record if it has already been read.  Something like:
 
local stringvar good := "";
local stringvar current;
 
current := "|" + totext({table.date}) + "^" + totext({table.family}) + "$" + {table.program} + "|";
 
if instr(good, current) > 0 then
  false;
else(
  good := good + current;
  true;
);
 
something like this should work as it only allows in one copy of the record, which is fine as long as the rest of the data is same.
 
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