Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Right outer join greyed out Post Reply Post New Topic
Author Message
Pobble
Newbie
Newbie


Joined: 20 Jan 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote Pobble Replybullet Topic: Right outer join greyed out
     Posted: 04 Mar 2012 at 9:27pm
I have two tables, a product one and a sales history on which are linked by stock code.

What I want to look at is products that I have not sold any of each month.

I have joined the two tables and wanted to do a right outer join from the product to the sales table so that any product records without sales would also be listed

The right outer join option in database expert is greyed out, as is full outer join. Any ideas why?

If I run the report with left outer join I only get matching records when I want to get non matching as well.

I have tried reversing the lik between the two tables, but still get the same results.

Any ideas?

Thanks
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 05 Mar 2012 at 1:53am
Not too sure myself on the joining...

I would have assumed the left outer join would have worked (assuming your PRODUCT table is the Primary table)

one short term bypass method would be:

GROUP by {products.stockcode}
 
Then instead of putting your date range into the select expert, put it into the formula.

for example, if you report looked like this:
 
GH1 - {products.Stockcode}    (sum of {saleshistory.quantity})

instead of select expert: (saleshistory.month) is equal to "January"
 
 
write a QUANTITY formula  {@quantity} that reads:

IF {saleshistory.month}="January" THEN {saleshistory.quantity}

and sum using this formula rather than the database field, {saleshistory.quantity}
 
 
This will give you a full list of your products regardless of whether you have sold any or not.

You could then put this {@quantity} formula into the select expert as:
is equal to 0
 
 
showing only products that you have not sold in the month of January.


Regards,

Michael Jones
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