Left Outer Join Question

Alright, this may be a stupid question, but here goes. I understand joins and have used SQL to do them many times. However, I am seeing weird behavior from Crystal and I want to know if I’m doing something incorrectly.

If I have a Sales Order Table and a Shipping Table and they are linked based up the Sales Order Number, shouldn’t I get all the Sales Order information if I left outer join it to the Shipping Table regardless of whether there are shippers in that table or not?

The behavior I am seeing in Crystal is that the Sales Orders in the Sales Tables which have not shipped yet are not shown on the report at all. I don’t have any selection formula which would make this happen either.

TIA.


DaveS (BOB member since 2008-01-09)

Do you have any filters in the report?
Have you tried to run the query in Toad and check whether you are getting the desired results or not?

Chand


cyberdude :india: (BOB member since 2007-02-05)

Thanks for the reply.

No, no filters yet. Stupid question though, what’s Toad? I googled it and still am not sure what you’re talking about.


DaveS (BOB member since 2008-01-09)

Toad is an application that you can use to run SQL against databases. Other tools include SQL Programmer, DB Artisan etc.

Generally when I have these kinds of problems I’d start by breaking the report down to the smallest pieces where everything works. So just join 2 tables and make sure you are getting what you want. One thing to double check is to make sure that you should be using a left outer join. Try it with a right outer join or even try a full outer to see if you get what you are looking for. Then as you add additional tables and columns when something breaks you will have a better idea what is breaking.


edurda :us: (BOB member since 2005-09-08)

May be it has to do with “Enforce the Join” option.


kurt (BOB member since 2006-11-06)

You can get TOAD from www.toadsoft.com. It’s a nice free database querying tool.

Judy


JMulders :us: (BOB member since 2002-06-20)