title: Oracle date difference SQL query
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1096853/calculate-difference-between-2-date-times-in-oracle-sql">Calculate difference between 2 date / times in Oracle SQL</a>  </p>
  </blockquote>
  
  
  
  <p>I have a table where PurchasedDate is maintained. I have to get the date from the system and calculate the date difference in days. datediff() is not giving tHe result as I am working in Oracle.</p>
  
  <p>Sample table:</p>
  
  <pre>
  ProductID  Date
  P101       31-DEC-2012
  P102       29-DEC-2011
  </pre>
  
  <p>If P102 is returned today, the difference should be 10.</p>
  
  <p>Here is a detailed description</p>
  
  <pre>
  BillID     ProductID   Date
  101          P101        31-DEC-2012
  101          P102        31-DEC-2012
  102          P405        29-JUN-2012
  102          P210        29-JUN-2012
  105          P205         2-MAY-2012
  </pre>
  
  <p>If a customer comes to retun a product P101 with BillNo 101, then the system should calcualte the difference between the return date(which is the system date) and the purchased date. The answer for P101 should be 10 if its returned on Jan 8 2012</p>