title: Subquery Syntax Discrepancy in Microsoft Query
body: <p>I posted a question last week about using subqueries in Microsoft Query, and although my problem in that instance was not solved, I've found the problem to be much more basic than in that previous case.</p>
  
  <p>I'm connected to an Informix database via ODBC trying in Microsoft Query (from Excel 2010) to perform a simple query, and am having a lot of trouble trying to get the syntax for subqueries correct. I have a feeling that MSQuery is getting hung up on some idiosyncrasy related to the Informix/ODBC source. My reason for thinking this is because if I try a very simple subquery using an Excel spreadsheet as my datasource, the following syntax works:</p>
  
  <pre><code>SELECT * FROM
  (
  SELECT x0.field1, x0.field2
  FROM `C:\USERS\NAME\DIRECTORY\Test.xlsx`.`Sheet1$` x0
  )
  </code></pre>
  
  <p>However, when I try the same very simple query using a subquery from my Informix db,</p>
  
  <pre><code>SELECT * FROM
  (
  SELECT x0.id, x0.creation_date
  FROM coastal.waybill x0
  )
  </code></pre>
  
  <p>I get the error <code>"Could not add the table '(select'."</code> All I can surmise is that the syntax one uses in MSQuery has to be tailored to the data source. However, when I looked up  <a href="http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.sqlt.doc/sqlt101.htm" rel="nofollow">Informix's syntax for subqueries in the FROM clause</a> I got even more confused, because it appears that I followed their syntax to a tee, since their example is:</p>
  
  <pre><code>SELECT LIMIT 1 * FROM 
     (SELECT c.customer_num, c.lname, c.company, 
             c.phone, u.call_dtime, u.call_descr
                   FROM customer c, cust_calls u
                   WHERE c.customer_num = u.customer_num
      ORDER BY u.call_dtime DESC);
  </code></pre>
  
  <p>I'm thoroughly lost. Any assistance would be greatly appreciated!</p>