title: SYSDATE minus some date variable returns a different value
body: <p>I'm using Oracle 11g and having a problem in finding the difference of days between two dates - (Sysdate) and some date variable. The difference then would be multiplied to another number. Below are the two methods I have tried but kept returning a negative value.</p>
  
  <p>The newly assigned <code>return_date</code> variable has a correct value.</p>
  
  <p>Thanks in advance for the help!</p>
  
  <pre><code>UPDATE borrowed_books
      SET penalty_fine = (TO_DATE(sysdate, 'dd-mm-yyyy') - TO_DATE(return_date, 'dd-mm-yyyy')) * 20,
          return_date = SYSDATE
          WHERE patron_id = patID AND
                transaction_id = transID;
  </code></pre>
  
  <pre><code>UPDATE borrowed_books
         SET penalty_fine = (sysdate - return_date) * 20,
             return_date = SYSDATE
             WHERE patron_id = patID AND
                   transaction_id = transID;
  </code></pre>