Re: Rounding Date to Beginning of Year

From: Steven Kondolf <skondolf_at_nospam.rochester.rr.com>
Date: Wed, 17 Mar 2004 23:12:23 GMT
Message-ID: <simh50thmndhuql8plg58h68370s6pr4o1_at_4ax.com>


I think you're confusing trunc with round:

SQL> select trunc(to_date('01-jul-04'),'yyyy') from dual;

TRUNC(TO_



01-JAN-04 SQL> c/trunc/round
  1* select round(to_date('01-jul-04'),'yyyy') from dual;

ROUND(TO_



01-JAN-05 On Wed, 17 Mar 2004 20:19:03 GMT, Terry Coccoli <request_at_ifneeded.com> wrote:

>This rounds up to 1st of following year after July 1, according to
>Oracle documenation.
>
>I'm looking for something that will arounds round up to 1st of year
>given any date, even for dates beyond July 1.
>
>I should have explained that in my initial post. Sorry about that.
>
>
>bdragos wrote:
>
>> SELECT trunc(SYSDATE, 'YYYY') FROM dual
>>
>> "Terry Coccoli" <request_at_ifneeded.com> wrote in message
>> news:f826c.10952613$Of.1835450_at_news.easynews.com...
>>
>>>Anyone have a simple method of doing this, using a minimal amount of
>>>functions ?
>>>
>>
>>
>>
Received on Thu Mar 18 2004 - 00:12:23 CET

Original text of this message