Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Duplicate Data - making it go away Post Reply Post New Topic
Author Message
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Topic: Duplicate Data - making it go away
     Posted: 17 Nov 2009 at 10:40am
Hi there,
 
I was wondering if anyone could tell me how to get rid of a duplicate data segment.  I know how to supress the data I don't want, but my issue is a llittel different.
 
I have a row of Date of Birth, Age, Sex, Race and Reason.  If there are two reasons in my selection, the information is repeated on another line below. 
 
How can I get the information to appear only once by reading the most current reason?
 
Thanks,
 
Lorimack
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Nov 2009 at 11:00am
1. What is your data type/source?  SQL?
2. Do you have control over that source? E.g. can you add views or stored procs?
3. How are you defining the "current" reason based on the data?


Edited by DBlank - 17 Nov 2009 at 11:01am
IP IP Logged
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Posted: 17 Nov 2009 at 11:08am

The data type is SQL.

I don't have control over the source to add anything.

My report looks like this at the moment.  The  

Name  R/S    DOB          Reason
Smith   W M   01/01/80  ICE
Smith   W M   01/01/80  ICE
Jones   W F  12/02/79  OTHE
Baker   W F  05/22/78    FED
 
I would like to have the second Smith removed based on the duplicate data for the reason. 
 
I am sure I am confusing you because I think I might be starting to confuse myself.

 

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 17 Nov 2009 at 12:12pm
Did you choose 'Select Distinct Records' under the 'Database' menu item?
IP IP Logged
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Posted: 17 Nov 2009 at 12:24pm
I knew it was an easy fix!  Thanks so much!  That worked!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Nov 2009 at 12:26pm
fyi...
kevlray's suggestion should work if you have no data in use that is different from one row t the next.
However, if you have a date field somehwere that is related to the Reason field and the the same user has 2 (or more) different "reasons" it would not work.
You could write a Command to group the data and use the MAX(date) that is the related data for your "most recent reason".
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