Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: CR multiple joins with duplicates HELP Post Reply Post New Topic
Author Message
Chaseshaw
Newbie
Newbie


Joined: 05 Aug 2009
Online Status: Offline
Posts: 3
Quote Chaseshaw Replybullet Topic: CR multiple joins with duplicates HELP
     Posted: 18 Oct 2010 at 3:21pm
Greetings!

I have three tables to join for three columns in a report, coming from MS SQL. The tables are NAMES, CARS, and BICYCLES. So I select the three tables, and do the joins in CR in the database expert.

Then for the data:
NAMES:
Bob
Steve
John

CARS:
Bob, Ford, 1999
Bob, Jaguar, 2000
Steve, Mustang, 2000
Steve, Chevy, 2001
John, Lincoln, 2004

BICYCLES:
Bob, BMX1, 1997
Bob, BMX2, 2000
Bob, BMX3, 2005
Steve, BMX1, 2004
Steve, BMX2, 2004
John, BMX3, 2006
John, BMX3, 2007


I would like the data to return:
Bob------Ford------BMX1
---------Jaguar----BMX2
-------------------BMX3
Steve----Mustang---BMX1
---------Chevy-----BMX2
John-----Lincoln---BMX3
-------------------BMX3

But instead returns:
Bob----Ford-------BMX1
------------------BMX2
-------Jaguar-----BMX1
------------------BMX2
Steve--Mustang----BMX1
------------------BMX2
-------Chevy------BMX1
------------------BMX2
etc...

and creates duplicates. how to I get rid of this?

In SQL what I would need is SELECT * FROM NAMES
LEFT OUTER JOIN CARS on NAMES.name = CARS.name
LEFT OUTER JOIN BICYCLES on NAMES.name = BICYCLES.name

but I cannot figure out how to emulate this in CR, and cannot rewrite the queries returning the data. How can I group these effectively?

Thanks
IP IP Logged
rybad80
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Location: United States
Online Status: Offline
Posts: 7
Quote rybad80 Replybullet Posted: 19 Oct 2010 at 6:06am
When you link the tables, are you linking names to cars using a common field (full name maybe?) with a Left Outer Join and names to bicycles using a common field again with a left outer join?
IP IP Logged
Chaseshaw
Newbie
Newbie


Joined: 05 Aug 2009
Online Status: Offline
Posts: 3
Quote Chaseshaw Replybullet Posted: 19 Oct 2010 at 10:02am
thanks for getting back to me. after working with it all afternoon, I discovered my problem is in my sql join theory, and that a left outer join returns the same thing. I have reposted in a sql forum. Thanks anyway!
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