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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joins 1

Status
Not open for further replies.

wakthar

Programmer
Jul 27, 2007
14
GB
In my report I want to join two tables Contracts and Turnover. When I use Database Expert and join the fields, the generated sql produces an INNER JOIN instead of the LEFT JOIN I wanted.

Two tables are joined on region, contract, period and year.
The generated SQL is

SELECT Crt.year, Crt.period, Crt.region, Crt.CrtNo, Cqt.Turnover
FROM Contracts Crt, Turnover Cqt
INNER JOIN Cqt ON
(((Crt.region=Cqt.region)
AND
(Crt.CrtNo=Cqt.CrtNo))
AND
(Crt.year=Cqt.year))
AND
(Crt.period=Cqt.period)
WHERE
Crt.year=2006 AND Crt.period=3 AND Crt.region LIKE '%'
ORDER BY Crt.region, Crt.CrtNo


Instead of the INNER JOIN I would like to replace it with a LEFT JOIN.

Can this be done in the Database Expert??
 
Thanks for that...

How do you exactly 'Select the links and change them'?

As I can see, you can only link them one way and thats by dragging and dropping.

How do you change the sql generated from an INNER JOIN to LEFT JOIN?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top