Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: joining information from several records Post Reply Post New Topic
Author Message
Tieno
Newbie
Newbie
Avatar

Joined: 20 Oct 2010
Location: Netherlands
Online Status: Offline
Posts: 2
Quote Tieno Replybullet Topic: joining information from several records
     Posted: 20 Oct 2010 at 11:10am
Hi, I am using XI and do not know how to combine information from two (or more) records into one formula field.
The database I want to report on contains a table with the next fields:

ID     StartDate     PrevID
100   01/01/2010 
101   02/01/2010 
...
105   22/01/2010  101
106   22/01/2010  
etc.

There is no EndDate, but the end date is determined when finding a filled PrevID. So therefore I want to create a field in my report with the the end date based on the StartDate of a the ID record that contains a PrevID of a previous record.

How can I solve this? Thanks in advance.

Tieno
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2010 at 11:25am
add the table back onto itself doing a join
the join type will depend on if you only want 'closed' records (inner join) or all records (outer join)
the join will be on table.ID=table_1.PrevID


Edited by DBlank - 20 Oct 2010 at 11:25am
IP IP Logged
Tieno
Newbie
Newbie
Avatar

Joined: 20 Oct 2010
Location: Netherlands
Online Status: Offline
Posts: 2
Quote Tieno Replybullet Posted: 21 Oct 2010 at 12:29am
D, thanks very much. Clap
I managed to fill an end date by adding the table once more and using outer join to still display all records.
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