title: How to fix Incorrect syntax near ')'
body: <p>I tried a lot but can't find what is wrong with this query, It gave me this error:</p>
  
  <blockquote>
    <p>Incorrect syntax near ')'.</p>
  </blockquote>
  
  <pre><code>string query = "SELECT SUM(See) AS [All]
   , (
         SELECT TOP 1 See
         FROM StateSite
         WHERE StatDate = @StatDate
     ) AS [Now]
   , (
         SELECT TOP 1 See
         FROM StateSite
         WHERE StatDate = @Yesterday
     ) AS [Last]
   , (
         SELECT SUM(See)
         FROM (
             SELECT TOP 7 *
             FROM StateSite
             ORDER BY id DESC
         )
     ) AS [week]
  FROM StateSite";
  </code></pre>
  
  <p>also that works properly with access database but not by sql server.</p>