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

Sql Svr views to Access queries

Status
Not open for further replies.

DbHd

Programmer
Dec 20, 2004
39
I think I used to know this stuff a few decades ago, but....

I must have a new standalone Access app up & running by 4/1. To "save time" I brought forms over from a large adp and scripted the views from the Sql Svr back end.

I have a lot of the views converted to Access but am stymied on the remaining. It's the join statments that have me tied up. There are too many to list so here's a couple examples:
BTW I did a bulk delete of "OUTER" as in LEFT OUTER JOIN in case you think it looks weird.
-------
FROM tblOrg RIGHT JOIN tblPrt LEFT JOIN tlkpCny RIGHT JOIN tblEpd ON tlkpCny.CnyID = tblEpd.EpdIcnLstRes_CnyID ON tblPrt.PrtID = tblEpd.Epd_PrtID LEFT JOIN tblCnt ON tblEpd.EpdCsm_CntID = tblCnt.CntID ON tblOrg.OrgID = tblEpd.EpdSap_OrgID
------
another one
------
FROM tblOrg INNER JOIN tblCnt ON tblOrg.OrgRef_CntID = tblCnt.CntID FULL OUTER JOIN tblCbo ON tblOrg.OrgID = tblCbo.Cbo_OrgID FULL OUTER JOIN tlkpCny ON tblOrg.Org_CnyID = tlkpCny.CnyID
------
Pretty nasty for a guy who misses Compuserve. Where's Joe Celko when you need him??
 
first, your joins are structured incorrectly. Second, Access likes lots of parens in the join statements. I would suggest you read Understanding SQL Joins and look below for the parens and the structure.

FROM ((tblOrg
RIGHT JOIN tblPrt ON tblOrg.Somefield = tblPart.Somefield)
LEFT JOIN tlkpCny ON tblOrgSomefield. = tlkpCny.Somefield)
RIGHT JOIN tblEpd ON tblOrg.Somefield = tblEpd.Somefield

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top