Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Number of days -function

Re: Number of days -function

From: <sweidanz_at_yahoo.com>
Date: Wed, 17 Oct 2001 16:08:33 +1000
Message-ID: <Nvbz7.7$ip.328@nsw.nnrp.telstra.net>


If you are using SYSDATE (or any timestamp column) and you want to get number of days without decimals you need to use TRUNC

  1 SELECT trunc(sysdate) - to_date('01/01/2001', 'DD/MM/YYYY') as number_of_days
  2* from dual
U39_at_OVR3SYSC>/ NUMBER_OF_DAYS


           289

otherwise you get:

  1 SELECT sysdate - to_date('01/01/2001', 'DD/MM/YYYY') as number_of_days
  2* from dual
U39_at_OVR3SYSC>/ NUMBER_OF_DAYS


     289.66185 Received on Wed Oct 17 2001 - 01:08:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US