Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Comparing two field from different tables in CR Post Reply Post New Topic
Author Message
Inakawa
Newbie
Newbie


Joined: 24 Mar 2010
Online Status: Offline
Posts: 2
Quote Inakawa Replybullet Topic: Comparing two field from different tables in CR
    Posted: 11 May 2010 at 6:53pm
Hi,

I have two tables as follows

Table1
Field1   Field2
1        500   
2        600
3        300
4        400
5        200

Table2
Field1
1
3
5

The value in table one field1, contain values for table2 field1.

Now I want to compare Table2 field1 with Table1 Field1, if it return true, then print the corresponding value from table1 field2. If this is false though, to skip the record and continue searching for the second record.

So basically I want my end results (report) to be:

Table2.field1        Table1.field2
1                      500                         
3                      300
5                      200

Can anyone help please.

Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 May 2010 at 4:36am
Use the Databse expert
add table 1
add table 2
inner join table1 to table 2 on field 1
use table2.field1 and table1.field2 on your report canvas.
 
the join will omit the fields with no match.
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.030 seconds.