title: Sql query not working in Visual Studio 2010 report
body: <p>I have some problems with a report in Visual Studio 2010.
  I made a query in PostgreSQL that works fine when I run it in pgAdmin Sql Editor, however after I make a new Dataset and TableAdapter in VS2010 and add the query in Query Builder, I get the following error.</p>
  
  <pre><code>Error in list of function arguments: '(' not recognized.
  Error in list of function arguments: ')' not recognized.
  Error in WHERE clause near '1 months'.
  Unable to parse query text.
  </code></pre>
  
  <p>If I hit execute query, it returns the following error:</p>
  
  <pre><code>ERROR[42704]ERROR:type "INTERVAL" does not exists;
  </code></pre>
  
  <p>If I remove the double quotes that VS2010 is adding itself around "INTERVAL" and hit execute query again, it works but as soon as I hit OK, the quotes appear again. All that being said, if I right click the TableAdapter and hit Preview Data, the result is fine.</p>
  
  <p>Now if I make a report and add the above DataSet then make a WindowForm and add a ReportViewer connected to report, when I run it, nothing happens; all stays blank.</p>
  
  <p>Here is the query:</p>
  
  <pre><code>SELECT prod, mod, piece, no,
         rank() OVER (PARTITION BY mod ORDER BY no DESC)
  FROM (SELECT prod, mod, piece,
                 COUNT(qty) AS no
                 FROM com c 
                       INNER JOIN lines l ON c.idcom=l.idcom
                       INNER JOIN pieces p ON l.idpiece=p.idpiece
                       INNER JOIN models m ON p.idmodel=m.idmodel
                       INNER JOIN prods pr ON m.idprod=pr.idprod
                  WHERE c.date &gt;  CURRENT_DATE - INTERVAL '1 months'
                  GROUP BY piece,mod,prod) AS foo
  </code></pre>
  
  <p>I don't understand why if I Preview Data from the DataSet, the query runs fine(with all those parsing errors) but if I add it to the report, nothing happens. If you need more details, please ask. Thank you.</p>