title: Incorrect syntax near the keyword 'SELECT'. Incorrect syntax near ')'
body: <p>I used the sql code in vb.net</p>
  
  <pre><code>SELECT [Table1 Query].[amel_code], [Table1 Query].[kala_code], Sum([Table1 Query].
  [SumOfqty]) AS SumOfSumOfqty FROM(
  SELECT Table1.amel_code,
         Table1.amani_code,
         Table1.kala_code,
         Sum(Table1.qty) AS SumOfqty
  FROM Table1
  GROUP BY Table1.amel_code,
           Table1.amani_code,
           Table1.kala_code HAVING (((Table1.amel_code)=[?]) AND ((Table1.amani_code)&lt;[?]));
  )
  GROUP BY [Table1 Query].[amel_code], [Table1 Query].[kala_code];
  </code></pre>
  
  <p>This code is working properly but the sql web. Sheet gives the following error:</p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword 'SELECT'.
    Incorrect syntax near ')'.</p>
  </blockquote>
  
  <p>please help me.</p>