Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Too Many Records Post Reply Post New Topic
Author Message
thesmug1
Newbie
Newbie
Avatar

Joined: 12 Jun 2009
Online Status: Offline
Posts: 13
Quote thesmug1 Replybullet Topic: Too Many Records
     Posted: 07 Feb 2011 at 4:28am
I created a report recently that I need to pull an itemized list of the accessorial charges from TMW, e.g. the Fuel Surcharge or a Liftgate. Here's what I've done so far:

My Links:
TLORDER.DETAIL_LINE_ID <=>ACHARGE_TLORDER.DETAIL_LINE_ID
ACHARGE_TLORDER.ACODE_ID<=>ACHARGE_CODE.ACODE_ID
ACHARGE_CODE.ACC_TYPE<=>ACHARGE_TYPES.ACC_TYPE
TLORDER.DETAIL_LINE_ID<=>TRACE.DETAIL_NUMBER

In the Details section of my report, I currently have the field ACHARGE_TLORDER.CHARGE_AMOUNT. When I run the report, it correctly pulls the number of different charges for each day. However, it pulls each too many times. For instance, for one day it pulls $34.10 four times and $22.73 four times. However, when I add ACHARGE_TYPES.SHORT_DESC to the details line, it only pulls the $22.73 four times for the same day; in other words, it excludes the $34.10 charge.

Could anyone please help me get this report to pull the correct number of charges as well as only one of each kind of charge? So in the example I gave, could anyone please help me get only one $22.73 charge and only one $34.10 charge for that day? Any help would be greatly appreciated.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Feb 2011 at 3:49am
you would have to run the sql on the database. it sounds like your join is  too broad and you are getting a cartesian product of what you want.  It would seem that you need to find at least 1 more field that will narrow you selection down...
 
This is speculation, as I don't know what you database / data looks like nor how to join various tables together. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Feb 2011 at 5:31am
Not sure i can help you get your joins right but maybe a little info will help you.
When you create joins in Crystal the join is not inherently enforced. Meaning it acts as if it does not exist unless you either
1. Enforce the join in the join set up (middle part in the "link options" window)
2. Or you use a field from both tables in the join.
Option 2 explains why records are disappearing from your report as you add a field from a new table.


Edited by DBlank - 08 Feb 2011 at 5:31am
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