Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: outer join in record selection formula in CR Post Reply Post New Topic
Author Message
mani2011
Newbie
Newbie


Joined: 01 Jun 2012
Online Status: Offline
Posts: 2
Quote mani2011 Replybullet Topic: outer join in record selection formula in CR
    Posted: 04 Jun 2012 at 8:35pm
Hi,
 
I am trying to ennhace a crystal report. What I want is to add 2 columns in the report.
 
tech details:

I have a table "tref" with 2 of its fields as " areftype" and "arefcode".
areftype has values like "broker","owner","retail" ...
arefcode" has corresponding numbers.
 
My requirement is to add broker and owner columnd to report.
 
I could add it in the report by self join of tref table, but then I cannot put
 
tref.areftype (+)='broker'
and
tref_1.areftype(+)='owner'
 
in the record selection formula.
 
currently the result I am getting is only for the entries having both broker and owner details. where as for some entries either of them is present. In that case the missing field should appear as "null".
 
That is when I run a query in SQL developer is gived 60 rows (which is correct) but in CR it is just 6 rows.
 
CAn anybody suggest how to achieve the proper result as stated above?


IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Jun 2012 at 4:24am

I assume you're doing this in your selection criteria, correct?  If so, you'll also need to check for null.  So, your criteria will look like this (note the parentheses in red).

 
(IsNull({tref.areftype}) or {tref.areftype} = 'broker')
and
(IsNull({tref_1.areftype}) or {tref_1.areftype = 'owner')
 
Also, you have to check for Null first, otherwise it won't work.
 
-Dell
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.