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

Double Left Joins In a Query

Status
Not open for further replies.

mrfritz44

MIS
Nov 21, 2003
75
US
In standard SQL, this would work:

SELECT * FROM PS
LEFT JOIN LW ON PS.C = LW.C AND PS.DEPTID = LW.DEPTID
LEFT JOIN DY ON PS.C = LW.C AND PS.DEPTID = DY.DEPTID
ORDER BY PS.C, PS.DEPTID, PS.D, PS.S

How can I make it work via Access?

Thank you,

Fred
 
I don't think there's anything wrong with the query, maybe adding "access" parens would help?

SELECT * FROM (PS
LEFT JOIN LW ON PS.C = LW.C AND PS.DEPTID = LW.DEPTID)
LEFT JOIN DY ON PS.C = LW.C AND PS.DEPTID = DY.DEPTID
ORDER BY PS.C, PS.DEPTID, PS.D, PS.S
 
Anyway, JetSQL will choke here:
LEFT JOIN DY ON PS.C = [highlight]LW[/highlight].C AND PS.DEPTID = DY.DEPTID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top