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

FROM clause syntax

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I'm trying to use the below FROM clause in a query, but it is consistantly returning the error "Syntax error in JOIN operation." Could someone please help me understand why this error is occuring? Thanks.

Code:
FROM qryproductionreportdetailset
LEFT JOIN tblOrder ON qryproductionreportdetailset.OrderID = tblOrder.OrderID, qryproductionreportdetailset
INNER JOIN tblOrderDetail ON tblOrder.OrderID = tblOrderDetail.OrderID

--
Mike

"Don’t get suckered in by the comments – they can be terribly misleading. Debug
only code. – Dave Storer.
 
Thanks for the reply. I've updated the code but now I receive the error "Syntax Error (missing operator) in query expression..." Any ideas what could be causing this? Thanks.

Code:
FROM qryproductionreportdetailset LEFT JOIN tblOrder ON qryproductionreportdetailset.OrderID = tblOrder.OrderID INNER JOIN tblOrderDetail ON tblOrder.OrderID = tblOrderDetail.OrderID

--
Mike

"Don’t get suckered in by the comments – they can be terribly misleading. Debug
only code. – Dave Storer.
 
I've found the problem. THe updated code is...

Code:
FROM (tblOrder INNER JOIN qryProductionReportDetailSet ON tblOrder.OrderID = qryProductionReportDetailSet.OrderID) INNER JOIN tblOrderDetail ON tblOrder.OrderID = tblOrderDetail.OrderID

--
Mike

"Don’t get suckered in by the comments – they can be terribly misleading. Debug
only code. – Dave Storer.
 
Ok, your first query had left joins and now your solution only has inner joins, are you sure you are getting the correct information?

Leslie
 
I should have explained...

I tried typing the syntax by myself the first time incorrectly. I then created a new query, added the appropriate tables, and opened SQL View in order to see how Access generated the FROM. Thanks.

--
Mike

"Don’t get suckered in by the comments – they can be terribly misleading. Debug
only code. – Dave Storer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top