title: How to Count tickets as DateWise
body: <p>I have a query regarding my report, the report format is as under</p>
  
  <pre><code>**Date**           **Received**        **Closed**        **Pending**  
  12/01/10              1000                 900               100
  12/02/10              2000                1000              1000
  12/03/10              1500                1300               200
  </code></pre>
  
  <p>The above report shows the Help Desk tickets Received, Closed, Pending Count as date wise.</p>
  
  <p>How can I create a dynamic SQL query to show above result?</p>
  
  <ul>
  <li>Received Tickets is calculated on SubmitedDate </li>
  <li>Closed Tickets is calculated on ClosedDate with status "Closed" </li>
  <li>same for Pending Tickets whose status is "Pending".</li>
  </ul>
  
  <p>Please provide me the idea or some sample SQL queries. </p>