Print Page | Close Window

two fields one nul

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7936
Printed Date: 04 May 2024 at 11:41am


Topic: two fields one nul
Posted By: db3712
Subject: two fields one nul
Date 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.



Replies:
Posted By: Jyothi Yepuri
Date Posted: 06 Oct 2009 at 3:56pm
you can try left outer join...
post some sample data for the two table.


Jyothi


Posted By: themessenger
Date 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


Posted By: db3712
Date Posted: 07 Oct 2009 at 7:56am
Thank you both.  Got it working.  Really appreciate it.



Print Page | Close Window