Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Table link
Author
Message
dibblejon
Newbie
Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Topic: Table link
Posted: 03 Nov 2011 at 12:34am
Hi
Can somone please help me with a table linking issue I have?
The tables link on OrdID
In tbl1 OrdID can have multiple records for one order eg.
OrdID : 1234, 1234, 1234
But in tbl2 OrdID will only have one record eg.
OrdID : 1234, 1235, 1236 etc
I need to show all records from tbl1 so I see all lines on an order eg. 1234,1234 etc
What join type should I use?
IP Logged
yggdrasil
Senior Member
Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Posted: 03 Nov 2011 at 3:49am
Will every OrdId exist in both tables, or can there be an OrdId in table 2 that will not have a matching OrdId in table 1?
If there is always a match, it doesn't really matter what sort of join you use as all records will be returned.
If not and you want all Table 2 records even if there is no table 1 record for that OrdId, you will have to use
...table2 left outer join table1 on table2.OrdId = table1.Ord_id
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 03 Nov 2011 at 3:51am
if table 1 has at least one matching row per unique ordid in table 2 then you can use an inner join.
if table 1 has any ordid that does not exist in table 2 you would need an left outer join (assuming table1 as the left table)
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.