Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: two fields one nul Post Reply Post New Topic
Author Message
db3712
Groupie
Groupie
Avatar

Joined: 30 Oct 2008
Location: United States
Online Status: Offline
Posts: 44
Quote db3712 Replybullet Topic: two fields one nul
    Posted: 06 Oct 2009 at 3:45pm

Hi..

I have fields in two different tables.  One contains data.  One does not.  The deciding factor on which field contains data is based on what type of order it is.  The two fields never both contain data.  How can I write a formula to pull in the field containing data?
 
Appreciate your help.
IP IP Logged
Jyothi Yepuri
Senior Member
Senior Member


Joined: 11 May 2009
Location: Australia
Online Status: Offline
Posts: 127
Quote Jyothi Yepuri Replybullet Posted: 06 Oct 2009 at 3:56pm
you can try left outer join...
post some sample data for the two table.


Jyothi
IP IP Logged
themessenger
Groupie
Groupie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 48
Quote themessenger Replybullet Posted: 07 Oct 2009 at 3:42am
You could do something like this:

select
case where table1.field is null then table2.field else table1.field end as field
from
table1 inner join table2 on table1.key = table2.key
Managing Director
www.allmymenus.com
IP IP Logged
db3712
Groupie
Groupie
Avatar

Joined: 30 Oct 2008
Location: United States
Online Status: Offline
Posts: 44
Quote db3712 Replybullet Posted: 07 Oct 2009 at 7:56am
Thank you both.  Got it working.  Really appreciate it.
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.