Home » SQL & PL/SQL » SQL & PL/SQL » continuous week number
continuous week number [message #255466] Wed, 01 August 2007 00:29 Go to next message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
i want to generat continuous week numbers is it possible
for example

please check the following query

Select To_Char((trunc(SysDate,'yyyy')+(RowNum-1)), 'MON')
TMonth,To_Char((trunc(SysDate,'yyyy')+(RowNum-1)), 'YYYY') TYear,
To_Char((trunc(SysDate,'yyyy')+(RowNum-1)), 'ww') TWeek
From ( USER_OBJECTS ) Where RowNum <= 800


after DECEMBER - 2007 - 53
I WANT JAN -2008 - 54 (IN THE FIRST WEEK OF 2008)
BUT IT'S COMMING JAN - 2008 - 01

IS IT POSSIBLE TO GET 54....

THANKS IN ADVANCE
MUTHU
Re: continuous week number [message #255467 is a reply to message #255466] Wed, 01 August 2007 00:30 Go to previous messageGo to next message
BlackSwan
Messages: 25040
Registered: January 2009
Location: SoCal
Senior Member
>IS IT POSSIBLE TO GET 54....
Sure. Put it the table of your choosing & seed it with the desired answers.
Re: continuous week number [message #255471 is a reply to message #255466] Wed, 01 August 2007 00:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you want 54?

Regards
Michel
Re: continuous week number [message #255479 is a reply to message #255471] Wed, 01 August 2007 00:48 Go to previous messageGo to next message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
i want this logic to apply for other purpose ....

is it possible....
Re: continuous week number [message #255482 is a reply to message #255466] Wed, 01 August 2007 00:51 Go to previous messageGo to next message
BlackSwan
Messages: 25040
Registered: January 2009
Location: SoCal
Senior Member
>is it possible....
No, you are doomed to failure to depend upon week = 54.
It does NOT exist any where in the universe.
Re: continuous week number [message #255492 is a reply to message #255479] Wed, 01 August 2007 01:10 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
But do you want week 2 becomes week 55 or just week 1 becomes 54?
Without answering our question, you have no help.
You want to keep the information for yourself -> You're On Your Own (YOYO).

Regards
Michel
Re: continuous week number [message #255495 is a reply to message #255492] Wed, 01 August 2007 01:12 Go to previous messageGo to next message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
yes exactly i want like that...

2008 - week 1 as 54
and 2008 - week 2 as 55

Re: continuous week number [message #255496 is a reply to message #255495] Wed, 01 August 2007 01:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So your week is about ww+(year-2007)*53.

Regards
Michel

[Updated on: Wed, 01 August 2007 01:17]

Report message to a moderator

Re: continuous week number [message #255563 is a reply to message #255496] Wed, 01 August 2007 04:03 Go to previous message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
thanx
Previous Topic: modifying a view
Next Topic: Please explain UPDATE query (merged by LF)
Goto Forum:
  


Current Time: Tue Dec 06 00:00:56 CST 2016

Total time taken to generate the page: 0.10247 seconds