Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Linked tables omitting data Post Reply Post New Topic
Author Message
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet Topic: Linked tables omitting data
    Posted: 10 May 2017 at 8:41am
Hello,
I have linked two tables - billed & paid. I am trying to create a report that will list all the billed customers and have a column that will show whether they are paid or not. I have linked the two tables by invoice #. Here are the main headers:
Invoice    Customer   Paid
The customer's name comes from the billed table and the paid field comes from the paid table. When I insert the {paid.paid} field into the report, it will only show the invoices that have been paid. I would like ALL the invoices to show in the report and the unpaid invoices to either show as blank in the Paid column or "N". I tried creating a formula field for the Paid column as follows:
if {billed.invoice} = {paid.invoice} then
formula = {paid.paid} else formula = " " end if
I sincerely appreciate any help, thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2017 at 10:12am
You need to change your join to an outer join (likely left).
Keep in mind that additional select criteria might make it an inner join again,
IP IP Logged
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet Posted: 10 May 2017 at 10:35am
Wow! I did not realize there were different link options. Thank you so much, I'm going to read up on the types of joins and their uses. I've had similar troubles in the past with other reports and I'm thinking this changing the joins may have fixed the problems. Thanks, DBlank
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2017 at 10:39am
note that in crystal adding in two tables does not enforce the join. It is only if you choose to enforce it in the join set up or if you use a field from both ends of the joined tables. This is why you saw rows "disappear" when you used the first field from paid table. It was enforcing the join at that point.
There are a lot of posts re: this so search on phrases like
left join
outer join
enforce

Edited by DBlank - 10 May 2017 at 10:39am
IP IP Logged
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet Posted: 10 May 2017 at 10:51am
I see, that is good to know. I'll do some searching & studying. Thanks again
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.