Home » Other » Training & Certification » 256 th day in the year (Oracle 9i)
256 th day in the year [message #324312] Sun, 01 June 2008 23:36 Go to next message
kishorebonthala
Messages: 16
Registered: May 2008
Location: Bangalore
Junior Member

Hi friend,

I have one query..

I want to know the 256th in the year.

Exp: In a year 365 days are there, so i want to know 256 th day in that present year. Is it Monday,Tuesday.....

Regards,
Kishore
Re: 256 th day in the year [message #324314 is a reply to message #324312] Sun, 01 June 2008 23:39 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
kishorebonthala wrote on Sun, 01 June 2008 21:36
Hi friend,

I have one query..

I want to know the 256th in the year.

Exp: In a year 365 days are there, so i want to know 256 th day in that present year. Is it Monday,Tuesday.....

Regards,
Kishore

what does this question have to do with Oracle?

It is a simple calendar problem?

> Is it Monday,Tuesday.....

Does the answer depend upon which year the question is asked?

[Updated on: Sun, 01 June 2008 23:40] by Moderator

Report message to a moderator

Re: 256 th day in the year [message #324320 is a reply to message #324312] Mon, 02 June 2008 00:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
+ add a number of days.
TO_CHAR gives you the day name.

Regards
Michel
Re: 256 th day in the year [message #324380 is a reply to message #324312] Mon, 02 June 2008 04:36 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
SQL> select to_char(to_date('2008256','YYYYDDD'),'DAY') from dual;

TO_CHAR(TO_DATE('2008256','YYY
---------------------------------------------------------------------------
FRIDAY


For more information check the date formatting in sql reference manual.

Regards

Raj
Re: 256 th day in the year [message #324386 is a reply to message #324380] Mon, 02 June 2008 04:48 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
@Raj,

What about this part of OraFAQ Guide:
Quote:
When responding to questions, if it is obviously a student with a homework assignment or someone else just learning, especially in the homework and newbies forums, it is usual to provide hints or clues, perhaps links to relevant portions of the documentation, or a similar example, to point them in the right direction so that they will research and experiment on their own and learn, and not provide complete solutions to problems. In cases where someone has a real-life complex work problem, or at least it may seem complex to them, it may be best to provide a complete demo and explanation.


Regards
Michel
Re: 256 th day in the year [message #324397 is a reply to message #324386] Mon, 02 June 2008 05:33 Go to previous message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
I know you would come to that. The reason why I posted the code is because

a) It's monday morning and I am having fresh start
b) I am in a good mood

So I have posted the full solution. Smile

Next time I will strictly adhere to the forum guidelines.

Regards

Raj
Previous Topic: what Sequence select statmen will execute
Next Topic: Good Beginners Books
Goto Forum:
  


Current Time: Sat Nov 23 04:17:44 CST 2024