Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Tables with Unmatched Records Post Reply Post New Topic
Author Message
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Topic: Tables with Unmatched Records
    Posted: 30 Aug 2012 at 4:26am
I have a report that displays open orders by customer. I need to display the information about the order including the "Bill to" and "Ship to" names. Everything is contained in one table with the exception of the "Ship To". The "Ship To" is contained in a second table.

The problem is that not every order has a record in the second "Ship to" table. The only orders with records in that table are the ones where the programmed "Ship To" has been overridden while entering the order (drop shipments).

When an order does not have a record in both files, I'm getting duplicated records. I can suppress the duplicates, but that creates other problems, particularly with summarizing totals. I have experimented with different link types, but that doesn't seem to be making a difference.

Is there anything I can do to tell the report that if the order number isn't contained in the second table, then don't read the records in that table?
IP IP Logged
shanth
Groupie
Groupie


Joined: 06 Aug 2012
Location: United States
Online Status: Offline
Posts: 75
Quote shanth Replybullet Posted: 30 Aug 2012 at 5:27am
If I understand correct, Try using custom SQL, union two sql statements with different where conditions. For Ex: second sql after Union: Order number not equal to null in second table, something like that
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 31 Aug 2012 at 6:06am
an inner join should work if you have ordernum=ordernum in where clause
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 31 Aug 2012 at 6:09am
inner join with a select distinct
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.012 seconds.