Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

start date for the Quarter 2

Status
Not open for further replies.

ridhirao22

Programmer
Aug 27, 2010
140
US
Hi,

I have a column as YYYYQ. I need to get the Start date and last date of the Quarter:

For ex: 20092
Qtr Start date = 01-APR-2009
Qtr Last date = 01-JUN-2009

How do I do this?
Any help appreciated.

Thanks
RR
 
SantaMufasa, I'm not convinced this apparently weird behavior is a bug. Before I posted my earlier response, I attempted to verify whether it was a documented bug or a "feature". I couldn't find anything at all in the Oracle 10g database documentation about how "to_date(string, 'YYYY')" should perform. I then tried the same query in two 11g databases - 11.1.0.7 and 11.2.0.1 - and the result was the same as in 10g. I also found a discussion of the issue in the OTN sql forum where the consensus appeared to be that it was strange but not a bug.

So, if it is a bug, Oracle is being completely nonchalant about providing a fix. Quite the contrary, they have allowed the behavior to persist across at least three separate major releases. My guess is that when the issue was first brought to their attention they decided they were under no obligation to make a 'YYYY' format return January 1 for the month and day. I just wish they had documented this behavior a little better
 
Agreed on all counts, Karl. If it isn't a bug, then it is certainly both counter-intuitive and annoying.[banghead]

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
In the absence of the OP offering up stars to reward this interesting and informative discussion, have one each!

The internet - allowing those who don't know what they're talking about to have their say.
 
Very thoughtful, Ken. Thanks from Karl and me.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
I am really sorry for my unthoughtfulness. But both Karl and Mufasa posts were very helpful.

Two Thumbs up!

Thanks again.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top