Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Date Timestamp Functions
 

Subtract one date from another, yielding the number of days between the two dates

The following example subtracts July 31, 2003,  from August 2, 2003: SQL> SELECT TO_DATE('02-AUG-2003') - TO_DATE('31-JUL-2003') FROM dual; TO_DATE('02-AUG-2003')-TO_DATE('31-JUL-2003') ---------------------------------------------                                             2 SQL>