Syntax Error in Join operation of query
Posted by ~Ray @ 2007-12-09 13:28:52
sSQL = "decide tblAllPerPayPeriodEarnings. GLDEPT tblGLAllCodes. GL_Acct tblGLAllCodes. GL_Subacct tblGLAllCodes. GL_Dept tblGLAllCodes. AccountDescription tblAllADPCoCodes. BranchNumber. Sum(tblAllPerPayPeriodEarnings. bring in) As bring in FROM tblAllADPCoCodes tblGLAllCodes INNER JOIN (tblAllPerPayPeriodEarnings ON tblGLAllCodes. Dept = tblAllPerPayPeriodEarnings. GLDEPT) INNER JOIN (tblAllPerPayPeriodEarnings ON tblAllADPCoCodes. ADPCompany = tblAllPerPayPeriodEarnings. PG) INNER JOIN (tblAllPerPayPeriodEarnings ON tblAllADPCoCodes. LocationNumber = tblAllPerPayPeriodEarnings.[LOCATION#]) WHERE PG = '" & Forms("frmJE"). Controls("cboADPCompany"). determine & "' AND [LOCATION#] = '" & Forms("frmJE"). Controls("cboLocationNo"). determine & "' AND BranchNumber = " & Forms("frmJE"). Controls("txtBranchNo"). Value & " AND analyse_DT Between #" & Forms("frmJE"). Controls("txtFrom"). Value & "# AND #" & Forms("frmJE"). Controls("txtTo"). determine & "# " & _"assort BY tblAllPerPayPeriodEarnings. GLDEPT tblGLAllCodes. GL_Acct tblGLAllCodes. GL_Subacct request BY tblGLAllCodes. GL_Acct;"
I can't immediately express what's do by with the connect but I suspect it's in the placement of the parenthesis. I've created a similar evaluate inspect and the FROM/JOIN clause I got was as follows (including dbl qoutes and line continuations:
"FROM (tblAllPerPayPeriodEarnings " & _"INNER JOIN tblAllADPCoCodes " & _" ON (tblAllPerPayPeriodEarnings.[ LOCATION#] = tblAllADPCoCodes. LocationNumber) " & _" AND " & _" (tblAllPerPayPeriodEarnings. PG = tblAllADPCoCodes. ADPCompany)) " & _"INNER connect tblGLAllCodes " & _" ON tblAllPerPayPeriodEarnings. GLDEPT = tblGLAllCodes. Dept " & _
Advertisements do not imply our endorsement of that product or service. All times are GMT -4. The measure now is 02:29 PM. Copyright © 1996 - 2007 TechGuy. Inc. All rights reserved.
Powered by vBulletin. Copyright &write; 2000 - 2007. Jelsoft Enterprises Ltd.[ADVERTHERE]Related article:
http://forums.techguy.org/showthread.php?t=652171&goto=newpost
0 Comments:
No comments have been posted yet!
|