Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How does Crystal Doe its Record Selection Post Reply Post New Topic
Author Message
wan2fly99
Newbie
Newbie


Joined: 06 May 2010
Online Status: Offline
Posts: 15
Quote wan2fly99 Replybullet Topic: How does Crystal Doe its Record Selection
     Posted: 15 Nov 2011 at 5:14am
I have to tables  

vendor

ap

I have linked them up in database link  on a key field vendor-num  and said the vendor table is an outer join

In the report in the Select Expert:  I have another requirement to state that AP record the field balance <> 0

Now Does crystal first do the outer join and get all the records.

Then it goes to the Select Expert and filters out more?

I wanted all the vendor records and and only those AP records with balance not 0.  If no AP records for that vendor I still wanted the vendor record

It seems if AP record with balance of 0,  the associated vendor record does not get selected.


A bit confused here

Any help is appreciated
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Nov 2011 at 7:23am
it does the join and then the applies the select criteria so your seelct criteria can turn your outer join into acting as an inner join.
in this case you can use an isnull to prevetn that.
isnull(field) or field<>0
IP IP Logged
wan2fly99
Newbie
Newbie


Joined: 06 May 2010
Online Status: Offline
Posts: 15
Quote wan2fly99 Replybullet Posted: 15 Nov 2011 at 10:55am
thanks  and if the record doesn't even exit  then yu don't get anything back?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Nov 2011 at 11:50am
not sure i understand your question and now that i reread you post I am not sure my answer will work as you have likley have vendors associated to multiple AP records.  
my example was how to handle something like this
table_A (clients) 
table_B (client_balance)
link A to B as an outer join on clientid
not all clients have made a client balance
I want to see all clients with a zero balance or no balance (e.g. not in table b)
your select statement would be
isnull(table_B.balance) or table.balance = 0
 
You might need to explain your join and row level data in each table a little it more.
Usually you have to do what you want (if I am understanding better now) using a different source type like a sql store procedure/view (or its equivalent in your data type) or a crystal command. Or you have to suppress rows of data rather than exclude them.
IP IP Logged
wan2fly99
Newbie
Newbie


Joined: 06 May 2010
Online Status: Offline
Posts: 15
Quote wan2fly99 Replybullet Posted: 15 Nov 2011 at 12:27pm
actually i need all the vendor records  and any record in the accounts payable file.   It seems  if I put something in the select expert that has to do with ap  and doesn't match the selection  no record is selected even though   i want the vendor record  I think I have to put it into an sql  and run the sql instead

I wanted a true outer join everything in  table a  and records in table b if they exist and match the requirement
IP IP Logged
wan2fly99
Newbie
Newbie


Joined: 06 May 2010
Online Status: Offline
Posts: 15
Quote wan2fly99 Replybullet Posted: 15 Nov 2011 at 12:38pm

IP IP Logged
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