title: Oracle equivalent to SQL Server/Sybase DateDiff
body: <p>We are now using NHibernate to connect to different database base on where our software is installed.  So I am porting many SQL Procedures to Oracle.</p>
  
  <p>SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate.</p>
  
  <p>Date parts examples are day, week, month, year, etc. . . </p>
  
  <p>What is the Oracle equivalent?</p>
  
  <p>I have not found one do I have to create my own version of it?</p>
  
  <p><strong>(update by Mark Harrison)</strong> there are several nice answers that explain Oracle date arithmetic.  If you need an Oracle datediff() see Einstein's answer.  (I need this to keep spme SQL scripts compatible between Sybase and Oracle.)  Note that this question applies equally to Sybase.</p>