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: USAGE OF ROUND AND TRUNC FUNCTIONS

Re: USAGE OF ROUND AND TRUNC FUNCTIONS

From: Gump <stoopidstoopidstoopid_at_hotmail.com>
Date: 14 Feb 2005 21:59:15 -0800
Message-ID: <1108447155.945648.151050@c13g2000cwb.googlegroups.com>


ROUND returns date rounded to the unit specified by the format model.

The TRUNC (date) function returns date with the time portion of the day truncated to the unit specified by the format model.

SQL> select round (to_date('30jun2005','ddmonyyyy'), 'YEAR') from dual;

ROUND(TO_



01/JAN/05 SQL> select round (to_date('01jul2005','ddmonyyyy'), 'YEAR') from dual;

ROUND(TO_



01/JAN/06 SQL> select trunc (to_date('30jun2005','ddmonyyyy'), 'YEAR') from dual;

TRUNC(TO_



01/JAN/05 SQL> select trunc (to_date('01jul2005','ddmonyyyy'), 'YEAR') from dual;

TRUNC(TO_



01/JAN/05 Received on Mon Feb 14 2005 - 23:59:15 CST

Original text of this message

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