sql - Query syntax on a large inner-joined select query linked to a control giving runtime 3071 error message -


i getting runtime error message 3071 on following query stating query complex. have created queries in past have seemed more complex one. understand generates message:

sql_get = "select tblvaluechain01.idmacroprocesso, tblvaluechain02.idmicroprocesso02, tblvaluechain03.id, tbldependencies01.id dependencyid, tblvaluechain02.microprocesso02, tblvaluechain01.macroprocess, tblvaluechain01.teamlead, tblvaluechain01.lastorganisationdate, tblvaluechain01.tempiindeterminati, tblvaluechain01.tempideterminati, tblvaluechain01.interinali, tblvaluechain01.parttime, tblvaluechain01.dailyminutesaverage minutes01, tblvaluechain01.dailyminuteshigh minutes01h, tblvaluechain01.dailyminuteslow minutes01l, tblvaluechain02.microprocesso02, " & _ "tblvaluechain02.dailyminutesaverage minutes02, tblvaluechain02.dailyminuteshigh minutes02h, tblvaluechain02.dailyminuteslow minutes02l, tblvaluechain03.microprocess, tblvaluechain03.minutesperday minutes03, tblvaluechain03.minutesperdayhigh minutes03h, tblvaluechain03.minutesperdaylow minutes03l, tbldependencies01.flowdescription, tbldependencies01.flowtype, tblteamsdepartments.department, tblteams.team, tbldependencies01.precision, " & _ "tbldependencies01.servicedelivery , tbldependencies01.riskreduction, tbldependencies01.capacitycreation, tbldependencies01.targetcapacitycreation, tbldependencies01.feasibility, tbldependencies01.timeframe, tbldependencies01.priority, tbldependencies01.note, tbldependencies01.redundantcontrols, tbldependencies01.redundantcontrolsnotes, tbldependencies01.redundantcontrolspotsolution, tbldependencies01.redundantcontrolsnotessymbol, tbldependencies01.redundantcontrolspotsolsymbol, tbldependencies01.rolesandresponsibilities, tbldependencies01.rolesandresponsibilitiesnotes, " & _ "tbldependencies01.rolesandresponsibilitiespotsolution , tbldependencies01.rolesresponnotessymbol, tbldependencies01.rolesresppotsolsymbol, tbldependencies01.substandardsvcs, tbldependencies01.substandardsvcsnotes, tbldependencies01.substandardsvcspotsolution, tbldependencies01.substandardsvcsnotessymbol, tbldependencies01.substandardsvcspotsolsymbol, tbldependencies01.knowledgegaps, tbldependencies01.knowledgegapsnotes, tbldependencies01.knowledgegap, " & _ "potsolution , tbldependencies01.knowledgegapsnotessymbol, tbldependencies01.knowledgegapspotsolsymbol, tbldependencies01.excessiveoversight, tbldependencies01.excessiveoversightnotes, tbldependencies01.excessiveoversightpotsolution, tbldependencies01.excessiveoversightnotessymbol, tbldependencies01.excessiveoversightpotsolsymbol, tbldependencies01.upstreamerrors, tbldependencies01.upstreamerrorsnotes, tbldependencies01.upstreamerrorspotsolution, tbldependencies01.upstreamerrorsnotessymbol, tbldependencies01.upstreamerrorspotsolsymbol, tbldependencies01.defectsrework, " & _ "tbldependencies01.defectsreworknotes , tbldependencies01.defectsreworkpotsolution, tbldependencies01.defectsreworknotessymbol, tbldependencies01.defectsreworkpotsolsymbol, tbldependencies01.overproduction, tbldependencies01.overproductionnotes, tbldependencies01.overproductionpotsolution, tbldependencies01.overproductionnotessymbol, tbldependencies01.overproductionpotsolsymbol, tbldependencies01.motiontransport, " & _ "tbldependencies01.motiontransportnotes , tbldependencies01.motiontransportpotsolution, tbldependencies01.motionnotessymbol, tbldependencies01.motionsolsymbol, tbldependencies01.downtimewaiting, tbldependencies01.downtimewaitingnotes, tbldependencies01.downtimewaitingpotsolution, tbldependencies01.waitdowntimenotessymbol, tbldependencies01.waitdowntimesolsymbol, tbldependencies01.excessivehandoffs, tbldependencies01.excessivehandoffnotes, tbldependencies01.excessivehandoffpotsolution, " & _ "tbldependencies01.excessivehandoffssymbol , tbldependencies01.excessivehandoffspotsolsymbol, tbldependencies01.rcslabreachinternal, tbldependencies01.rcslabreachexternal, tbldependencies01.rccorporatepolicybreach, tbldependencies01.rcoperatingmodeldiscrepancy, tbldependencies01.rrslabreachinternal, tbldependencies01.rrslabreachexternal, tbldependencies01.rrcorporatepolicybreach, tbldependencies01.rroperatingmodeldiscrepancy, tbldependencies01.ssslabreachinternal, tbldependencies01.ssslabreachexternal, tbldependencies01.sscorporatepolicybreach, " & _ "tbldependencies01.ssoperatingmodeldiscrepancy , tbldependencies01.kgslabreachinternal, tbldependencies01.kgslabreachexternal, tbldependencies01.kgcorporatepolicybreach, tbldependencies01.kgoperatingmodeldiscrepancy, tbldependencies01.eoslabreachinternal, tbldependencies01.eoslabreachexternal, tbldependencies01.eocorporatepolicybreach, tbldependencies01.eooperatingmodeldiscrepancy, tbldependencies01.ueslabreachinternal, tbldependencies01.ueslabreachexternal, tbldependencies01.uecorporatepolicybreach, tbldependencies01.ueoperatingmodeldiscrepancy, tbldependencies01.defslabreachinternal, " & _ "tbldependencies01.defslabreachexternal , tbldependencies01.defcorporatepolicybreach, tbldependencies01.defoperatingmodeldiscrepancy, tbldependencies01.opslabreachinternal, tbldependencies01.opslabreachexternal, tbldependencies01.opcorporatepolicybreach, tbldependencies01.opoperatingmodeldiscrepancy, tbldependencies01.ehslabreachinternal, tbldependencies01.ehslabreachexternal, tbldependencies01.ehcorporatepolicybreach, " & _ "tbldependencies01.ehoperatingmodeldiscrepancy , tbldependencies01.dtslabreachinternal, tbldependencies01.dtslabreachexternal, tbldependencies01.dtcorporatepolicybreach, tbldependencies01.dtoperatingmodeldiscrepancy, tbldependencies01.ecslabreachinternal, tbldependencies01.ecslabreachexternal, tbldependencies01.eccorporatepolicybreach, tbldependencies01.ecoperatingmodeldiscrepancy " & _ "from (tblteamsdepartments inner join tblteams on tblteamsdepartments.id = tblteams.department) inner join (tblvaluechain01 inner join ((tblvaluechain03 inner join tblvaluechain02 on tblvaluechain03.idmacroprocess = tblvaluechain02.idmicroprocesso02) inner join tbldependencies01 on tblvaluechain03.id = tbldependencies01.idsubprocess) on tblvaluechain01.idmacroprocesso = tblvaluechain02.idmacroprocesso01) on tblteams.id = tbldependencies01.group [tbldependencies01].[id]= '" & id & "'" form_frmvaluechaindynamic01.form.recordsource = sql_get 

possible typo:

... inner join tblvaluechain02 on tblvaluechain03.idmacroprocess = tblvaluechain02.idmicroprocesso02)` ... 

...perhaps should idmacroprocesso (missing "o" @ end of field)?

is [tbldependencies01].[id] number field? if so, in where clause you've used single quotes denoting you're expecting match string; this:

where [tbldependencies01].[id]= '" & id & "'" 

...should written this, if id number:

where [tbldependencies01].[id]=" & id 

you've referred fields in select clause using tablename.fieldname convention except potsolution (this may not issue, it's consistent!)

some more things try if above doesn't work: http://allenbrowne.com/subquery-02.html#querytoocomplex


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -