Note that there are some explanatory texts on larger screens.

plurals
  1. POMs Access SQL Query syntax error
    primarykey
    data
    text
    <p>the following is my ms access sql query </p> <pre><code> SELECT '2012/8' AS [Period], yearmonth.[Monthno (PS)] AS monthno, [assignment_2012].[cluster code] AS cluster, 'Transfer out' AS Remark, -1*Count(*) AS [number], '5' AS [sorting] FROM [assignment_2012] INNER JOIN namesort ON [assignment_2012].post = namesort.post INNER JOIN yearmonth ON [assignment_2012].[year month]=yearmonth.[Year Month (HM)] INNER JOIN (SELECT empid FROM (SELECT empid, [cluster], Count(*) AS [empid no] FROM (SELECT [ID] as empid, [Cluster Code] as cluster FROM [assignment_2012] INNER JOIN yearmonth ON [assignment_2012].[year month] = yearmonth.[Year Month (HM)] WHERE yearmonth.[Monthno (PS)] = 243 AND [assignment_2012].hc_adj = 1 AND [assignment_2012].term &lt;&gt; 'Temporary' UNION SELECT empid, [cluster] FROM [2012] WHERE monthno = 244 AND [2012].term &lt;&gt; 'Temporary' AND ( div &lt;&gt; 'XXX' OR div IS NULL ) AND hc = 1) GROUP BY [empid], [cluster] HAVING Count(*) = 1) GROUP BY empid HAVING Count(*) &gt; 1) As Emps ON [assignment_2012]].EmpID = Emps.EmpID WHERE yearmonth.[Monthno (PS)] = 243 AND [assignment_2012].hc_adj = 1 AND yearmonth.[Monthno (PS)] BETWEEN namesort.monthno_start AND namesort.monthno_end AND [assignment_2012].term &lt;&gt; 'Temporary' GROUP BY yearmonth.[Monthno (PS)], [assignment_2012].[cluster code] </code></pre> <p>When i run the query, it prompt message that "syntax error (missing operator) in query expression '[assignment_2012].post = namesort.post INNER JOING........"</p> <p>i found that it return error if it include "INNER JOIN yearmonth ON [assignment_2012].[year month]=yearmonth.[Year Month (HM)]" in the sql statement </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload