title: Oracle Count number of records each hour
body: <p>I'm trying to get the number of records created each hour but running into trouble with getting the results to group correctly. The idea is similiar to: <a href="https://stackoverflow.com/questions/9229862/how-to-count-number-of-records-per-day">How to count number of records per day?</a></p>
  
  <p>However, the field I'm using to Group by is a Date-time field that records down to the second. This seems to be causing trouble with the Group By statement, as when the query returns, there is one row for each second in the specified time period, which is way too much data and will make the work I want to do with the results more difficult than it needs to be (if for no other reason that it's too many rows to fit on one Excel sheet).</p>
  
  <p>My current code is:</p>
  
  <pre><code>SELECT ASD, Count(ASD) Num_CR
  From DB_Name.Table_Name fcr
  Where trunc(fcr.ASD) &gt; to_Char('31-DEC-2014')
      And trunc(fcr.ASD) &lt; to_Char('31-JAN-2015')
      And fcr.Status_Code = 'C'
  Group By ASD
  Order By ASD;
  </code></pre>
  
  <p>I've tried changing the Group By to be trunc(ASD), but that results in Toad throwing this error: ORA-00979: not a GROUP BY expression.</p>
  
  <p>Thanks in advance!</p>