Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Joining Table's Post Reply Post New Topic
Author Message
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Topic: Joining Table's
    Posted: 29 Jan 2010 at 3:47am
Hey Guys,
 
Question about joining table's for a report
 
This is my Table situation
 
Table1              Table2            Table3
Receptie            Recregel          BinFac
r_number    <>     r_rnumber
                     r_binfac     <>  b_number
 
The first table contains information about incomming goods but only global info no detail about what was delivered
the 3e table contains information about incomming invoices again only global info no detail about what is on the invoice (total price / company / ...)
the second one can link those 2 on the r_rnummer and r_binfac colum
 
Problem is that both the 1 and the 3 table the r_number and b_number are unique keys, so every record has his r_number with info about those invoice / reception
when i link those 2 (to see if the totals are the same) it has to go over the recregel table and that one has multi lines for every number as it contains details about exactly what is delivered (so if 10 pieces are delivered there are 10 lines )
 
when i only post the r_number in my crystal report i get every number 1 time, the moment i add the b_number i get every number x number of times depending on how many times that number is in the recregel
 
i'm trying to find a way arround that, i know i can make a group on the r_number but i would like to do it with inner/ outer / left or right join things
 
any idees ?
 
 
Greets Adam


Edited by AdamField - 29 Jan 2010 at 3:49am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 01 Feb 2010 at 11:27am

From what I see there is no way around grouping unless you want to see the details (i.e., delivered items).   If you are using a view, stored procedure or a command.  You can do the grouping in those.  It has been a while since I have done it, so I would have to look up on how to do it.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Feb 2010 at 11:33am
with just straight joins, you will have the duplication.  There isn't a way to get rid of them.  If you select just the fields that you need, you can do a select distinct, but CR doesn't allow that when you join tables.  A stored proc or view should be able to get around that.
 
HTH
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.032 seconds.