Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: eliminate duplicate lines Post Reply Post New Topic
Author Message
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Topic: eliminate duplicate lines
     Posted: 01 Jun 2009 at 8:33am
Table_A has one row where WO_ID = ‘123456’

Table_B has two rows where WO_ID = ‘123456’.
     The difference is Table_B.Order_Line_No = ‘1’ and ‘2’

Consequently my report shows 2 lines of data when only 1 is required.

I could do a row count and select on 1 only, but can’t you join them to obtain the results you want?

How do I join the tables to include everything in Table_A and only one instance of Table_B

If Left Outer results contains All A and the matching in B
and Right Outer results contains All B and the matching in A
how does either of these eliminate the second line in Table_B

PS. and when you join, do you have to change the link on every linked field or just one?

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Jun 2009 at 9:29am
Your join type wil not eliminate the duplicate records.
You possibly can use a select statement to eliminate the extra row or you could create stored procedure or view if you are using SQL to do this.
The question is more about what data you need from table_B. Since every record has two rows (one with line#=1 and line #=2) are there any other differences between the the rows? If not just eliminate the one row by making the select statement be "Table_B.Order_Line_No = ‘1’ ".
If there are other differences you need to figure out what you need and how to conditionally eleminate the extra rows based on those needs.
 
IP IP Logged
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Posted: 01 Jun 2009 at 10:38am
Table_B.Order_Line_No isn't only 1 or 2, it might be 78 or 53.
The remaining fields either contain the same data or are not a known entity 
I could select on.

I could use a SQL command to return the min row only but SQL commands slow down my reports so much it is unbearable for the user.

Views??? still waiting on "IT" to grant me permission to create - this would solve a lot a my frustrations!

Don't know what a stored procedure means.

For now, I'll just add a row count and suppress >1

edit - well I added the row count & suppressed but the summary total of the field still includes ll the suppressed data...so that doesn't work!


Edited by carstowal - 01 Jun 2009 at 10:42am
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