RE: given day of the year.

  • From: "David Kurtz" <info@xxxxxxxxxxxxxxx>
  • To: <thomas.mercadante@xxxxxxxxxxxxxxxxx>, <sjaffarhussain@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 15 Feb 2005 19:40:44 -0600

Remember to subtract 1 - 1st of January is the first day of the year, not
the zeroth.
So the 100th day of the current year is:

alter session set nls_date_format = 'HH24:MI:SS DD/MM/YYYY';
select trunc(sysdate,'yyyy')+100-1 from dual
/

TRUNC(SYSDATE,'YYYY
-------------------
00:00:00 10/04/2005

regards
_________________________
David Kurtz
Go-Faster Consultancy Ltd.
tel: +44 (0)7771 760660
fax: +44 (0)7092 348865
web: www.go-faster.co.uk
mailto:david.kurtz@xxxxxxxxxxxxxxx
Book: PeopleSoft for the Oracle DBA: http://www.psftdba.com
PeopleSoft DBA Forum: http://groups.yahoo.com/group/psftdba

> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Mercadante, Thomas F
> Sent: 15 February 2005 07:03
> To: 'sjaffarhussain@xxxxxxxxx'; oracle-l@xxxxxxxxxxxxx
> Subject: RE: given day of the year.
>
>
> Jaffar,
>
> Try
>
> select to_date('0101'||to_char(sysdate,'yyyy'),'mmddyyyy') + 100 from dual
>
> Tom
>
> -----Original Message-----
> From: Jaffar_DBA [mailto:sjaffarhussain@xxxxxxxxx]
> Sent: Tuesday, February 15, 2005 7:45 AM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: given day of the year.
>
> Hello list,
>
> Could any one give me the script or sql for the following requirements:
>
> If I need to know the 100th day of this year, like, If I pass value
> 100, want to extract the 100th day of the given year. Sunday 21,
> March, 2005. something like that.
>
>
>
> --
> Best Regards,
> Jaffar, OCP DBA
> Banque Saudi Fransi
> Saudi Arabia
>
>
> ------------------------
> It is your atittude,
> not your aptitude
> that determins your ultitude....
> --
> //www.freelists.org/webpage/oracle-l
> --
> //www.freelists.org/webpage/oracle-l
>



--
//www.freelists.org/webpage/oracle-l

Other related posts: