title: Oracle returns rows- Crystal reports doesn't
body: <p>I have a view i've created in Oracle. It returns rows, but when I use it through Crystal Reports, I get no rows. I've narrowed it down to this CTE in the query behind the view:</p>
  
  <pre><code>WITH PERIODS AS (
    SELECT
      ROWNUM-13 RN,
      TO_DATE('01-JUL-' || TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE),-6), 'YYYY')) AS FISCAL_YEAR_START,
      ADD_MONTHS(TO_DATE('01-JUL-' || TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE),-6), 'YYYY')), ROWNUM-13) AS MONTH
    FROM
      DUAL
    CONNECT BY
      ROWNUM &lt;= 24
  )
  </code></pre>
  
  <p>This is quite weird, as if I replace this CTE with the following, it works (this second query is what the original report had, but due to logical issues in finding the financial year, it had to be changed).</p>
  
  <pre><code>WITH PERIODS AS (
    SELECT
      ROWNUM-13 RN,
      ADD_MONTHS(TRUNC(sysdate,'yyyy'),6) AS FISCAL_YEAR_START,
      TRUNC(ADD_MONTHS(ADD_MONTHS(TRUNC(sysdate,'yyyy'),6), ROWNUM-13),'MONTH') MONTH
    FROM
      DUAL
    CONNECT BY
      ROWNUM &lt;= 24
  )
  </code></pre>
  
  <p>Any idea why the second CTE causes Crystal reports to not pull any records? There are definitely rows being returned with both queries, just Crystal Reports doesn't like the first query (although I don't understand why as I would have thought Crystal would simply query Oracle for the data, and not be bothered by what is behind the view?!)</p>