Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Comparing fields in different tables Post Reply Post New Topic
Author Message
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Topic: Comparing fields in different tables
     Posted: 24 May 2011 at 10:13am
I have a report that i am pulling information from a informix database and an access database. The report is mostly compiled from information in the informix side what i need is to have the line highlighted if the name exists in a table from the access side. I tried the using a formula if field a from the one = field b of the other in the format editor but it says th result must
be a number. i tried another way
 
if {tabel 1.field A} = {table 2.field A} then "LTL" but that acts like a select statement and only shows the the items that are in both tables if i add else"norm" at the end then it adds norm in the space
 
 
Thanks
KevV
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 May 2011 at 3:06am
Are you looking for the means to show unmatched values as well? If so you need to use an outer join.
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 25 May 2011 at 5:33am
I want it to show the unmacthed also but I want the ones that match to either be highlighted or to show the letters TL in a column.
 
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 May 2011 at 8:56am
Go to the section expert, highlight "Details" and go to the color tab; click backround color and go to the formula screen.

I am going to assume yellow is to highlight.

if val1<>val2 then crWhite else crYellow

I assume you want to highlight matches in this case




Edited by comatt1 - 25 May 2011 at 8:57am
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 25 May 2011 at 10:30am

When I put that formula in it does not highlight anything and it only brings up names that are in both tables.

IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 May 2011 at 6:02am
try something simple to start with
 
if val1 <> val2 then 1 else 0
 
place this next to the values
 
what do you get from the formula,
 
if you dont get a one or zero please paste your formula here that you are using.
sharona
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 01 Jun 2011 at 3:48am
If I insert the following formula into the report it only shows the ones if they are in both tables and it displays a 0
 
 
f {LTL.Vendor Name} <> {purorder.vendor_name} then 1 else 0
 
The "0" is the formula field

"SNACK FACTORY  0"



Edited by KevV - 01 Jun 2011 at 3:52am
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