Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Writing A Formula Post Reply Post New Topic
Author Message
figgy
Newbie
Newbie


Joined: 19 Nov 2013
Online Status: Offline
Posts: 23
Quote figgy Replybullet Topic: Writing A Formula
    Posted: 18 Mar 2015 at 7:39am
There is a section in my report for part #.  There are 3 different tables that depending on how the part was entered would give me the part number.  I need a formula that give me the first table if there is a part#, if not the 2nd table and if that also has nothing than the 3rd table.  Appreciate your help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Mar 2015 at 9:02am
the formula will not make it look into different tables it will just choose what value to display form your data set in that row (or group if needed).
you have to join (likely outer joins) you tables together properly and then use the resulting data set to determine your formula.
 
possibly something like
 
if isnull(table1.field) and isnull(table2.field) then table3.field else
if isnull(table1.field) and then table2.field else
table1.field
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Apr 2015 at 5:51am
DBlank is correct, you will need to get all the versions of the part # on the same row. Then you can create your formula to display the version that you want.

The 'trick' in report writing is how to get all your data into the same row. Otherwise, things get dicey.
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.031 seconds.