Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Left Outer" failing when used after a Stored Procedure 1

Status
Not open for further replies.

Madawc

Programmer
Sep 5, 2002
7,628
GB
I'm writing a report that sends letters to selected customers. The selection was too complex to be done without a Stored Procedure (SQL 8). So far, so good.

We normally use the account address, if this exists, and otherwise the customer address. I've done this lots of times, with a 'left outer' so that accounts are shown even if they have no account address.

In this case, every account without an account address was being excluded. When I looked at the SQL, it had something called a "CROSS JOIN", which I hadn't asked for.

I found a work-round, assembling the address in SQL. But I'm still curious about why the 'left outer' wasn't accepted in this case.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Can you post your code?

I've see programmers use a left outer join with a filter on the right hand side table which effectively cause the SQL to behave like a equal join, hence missing the unmatached records.

Fred

Cheers
Fred
 
I didn't put any selection code for the account address, just made a link to the account using account number.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Normally the left join became void if you pass parameters to any of the fields on the table you left join to or any other table subsequently link to it.



-Mo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top