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 Join on multiple conditions with greater than or less than

Status
Not open for further replies.

adam0101

Programmer
Jun 25, 2002
1,952
US
I have a query that looks like this:

Code:
SELECT  tbl1.id,
        tbl2.id
FROM    tbl1,
        tbl2
WHERE   tbl1.ActionDate > tbl2.StartDate
AND     (tbl1.ActionDate < tbl2.EndDate
        OR
        tbl2.EndDate IS NULL)

I'd like to turn it into a LEFT OUTER JOIN where I get all the items from tbl1 and only the items from tbl2 where the conditions in the WHERE clause are true. How would I do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top