Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Number of days -function
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