Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Eliminate duplicates Post Reply Post New Topic
Author Message
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Topic: Eliminate duplicates
    Posted: 21 Oct 2010 at 10:20am
Hi,
I am eliminating duplicate rows by using the section expert, selecting the detail section and adding the following formula next to the suppress no drill down option.
 
((Next({SJ000174.EMPLID}) =  {SJ000174.EMPLID}  And

Next({SJ000174.LAST_NAME})  = {SJ000174.LAST_NAME} And

Next({SJ000174.FIRST_NAME}) = {SJ000174.FIRST_NAME} And

Next({SJ000174.NATIONAL_ID}) = {SJ000174.NATIONAL_ID}  And

Next({SJ000174.LHS_DEPT_DESCR}) = {SJ000174.LHS_DEPT_DESCR} And

Next({SJ000174.LOCATION}) = {SJ000174.LOCATION} And

Next({SJ000174.REG_TEMP}) = {SJ000174.REG_TEMP}  And

Next({SJ000174.FULL_PART_TIME}) = {SJ000174.FULL_PART_TIME} And

Next({SJ000174.LHS_CONTRACT_DESCR}) ={SJ000174.LHS_CONTRACT_DESCR} And

Next({@POSITION TITLE}) = {@POSITION TITLE} And

Next({SJ000174.BUSINESS_UNIT}) = {SJ000174.BUSINESS_UNIT} And

Next({SJ000174.DEPTID}) = {SJ000174.DEPTID} And

Next({SJ000174.UNION_CD}) = {SJ000174.UNION_CD})

 
This code eliminates a duplicate row only. Is there a way how I can eliminate both rows from the report if they are identical. The rows were selected through SQL because another field that I am not pulling into crystal has changed and therefore the effdt has changed. I don't want to see either of the rows on the report if rows are identical.
 
Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Oct 2010 at 2:44am
I would think that OR in your formula with a duplicate but changing Next to Previous would work...  It's what I would try.
 
Preferable to this would be to eliminate them in the SQL select, so that you don't have to deal with them at all.
 
HTH
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 22 Oct 2010 at 5:30am
Hi,
I realize that changing the SQL query would be the best, I needed to do a quick fix(the underlying query is too complicated). I tried what you suggested using Previous and it worked, I also had to use NOT OnFirstRecord and NOT OnLastRecord to get the first and last row printed. 
 
Many thanks.


Edited by Zuzanna - 22 Oct 2010 at 5:37am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.