Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Adding data from 2 tables Post Reply Post New Topic
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: Adding data from 2 tables
    Posted: 10 Jun 2014 at 7:00am
I think this should be easy but I keep getting an error message.  I wrote a formula and it worked fine, simple formula:
IF {Material.Material} startswith "1O" THEN {Material.Material} ELSE " "

Then I tried to add one more table now I get an error message:
IF {Material.Material} startswith "10" THEN {Material.Material}, {Material.Vendor} ELSE " "

It keeps saying that the last section "{Material.Vendor} ELSE " "" doesn't belong in the formula.

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 10 Jun 2014 at 11:33am
You are not adding a table, but a field to the if then statement.  You seem to not understand the function of the if then statement.  If {some condition} then {do this} else {do that}. 

You cannot have two fields in the else unless you want to combine them in some way (i.e., {Material.Material}+{Material.Vendor})
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 11 Jun 2014 at 2:04am
That's exactly what I wanted to do.  I wanted to add the {Material.Vendor} to the {Material.Material} table.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 11 Jun 2014 at 4:10am
If you a space between the two fields then do this. {Material.Material}+" "+{Material.Vendor}
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 11 Jun 2014 at 4:52am
Thank you!  It was the "+" I needed in my formula not the ",".
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.016 seconds.