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!

Syntax errror in Join Operation

Status
Not open for further replies.

coolscan3

Programmer
Oct 23, 2001
40
0
0
GB
I have a Pass through query and am getting a syntax error in join operation.

sqlstr = "select fds.nonPMJobs.npmJobRef,fds.workorders.wodref " _
& " from fds.nonPMJobs " _
& " INNER JOIN fds.Workorders ON fds.NonPmJobs.npmJobRef = fds.Workorders.npmJobRef" _
& " where fds.NonPMJobs.loclevel3='WD23'"

Set qdf = db.CreateQueryDef("", sqlstr)

Help appreciated
 
A Pass through query should have a Connect property.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
This is the Complete Code

constr = "ODBC;DSN=PlanetEnterprise;Description=PlanetEnterprise;DATABASE=PlanetEnterprise;Trusted_Connection=Yes"

sqlstr = "select fds.nonPMJobs.npmJobRef,fds.workorders.wodref " _
& " from nonPMJobs " _
& " INNER JOIN fds.Workorders ON fds.NonPmJobs.npmJobRef = fds.Workorders.npmJobRef" _
& " where (((fds.NonPMJobs.loclevel3)='WD23'))"


Set qdf = db.CreateQueryDef("", sqlstr)

qdf.Connect = constr

Set rst = qdf.OpenRecordset()


Set Me.Form.Recordset = rst
 
Have you tried to create the very same query manually ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top