Home » Developer & Programmer » Reports & Discoverer » date to year and quarter (oracle 10.1.2)
date to year and quarter [message #336277] Fri, 25 July 2008 08:48 Go to next message
aarti81
Messages: 235
Registered: December 2007
Location: USA
Senior Member
Hi Can any one tell me a simple calculation to convert
date to year and quarter?

thnks
Re: date to year and quarter [message #336279 is a reply to message #336277] Fri, 25 July 2008 08:50 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
aarti81 wrote on Fri, 25 July 2008 06:48
Hi Can any one tell me a simple calculation to convert
date to year and quarter?

thnks

Use TO_CHAR() function & a little thought process.
Re: date to year and quarter [message #336281 is a reply to message #336279] Fri, 25 July 2008 09:05 Go to previous messageGo to next message
aarti81
Messages: 235
Registered: December 2007
Location: USA
Senior Member
Thank you sir

how about the following :
Select to_char(rec_date, 'yyyy') || to_char(rec_date, 'IW') As year_week,
to_char(rec_date, 'yyyy') || to_char(rec_date, 'mm') As year_month,
to_char(rec_date, 'yyyy') || '0' || to_char(rec_date, 'q') As year_quarter,
to_char(rec_date, 'yyyy') As year
FROM tbltest

I think too, just because i asked a question doesnt mean i didnt try it before asking and if you dont like to answer u can always shutup instead of your comments.I asked because i have to use a calculation in discoverer plus and discoverer doesnt accept a select in its calculation.............

thnks
anacedent wrote on Fri, 25 July 2008 08:50
aarti81 wrote on Fri, 25 July 2008 06:48
Hi Can any one tell me a simple calculation to convert
date to year and quarter?

thnks

Use TO_CHAR() function & a little thought process.

Re: date to year and quarter [message #336285 is a reply to message #336277] Fri, 25 July 2008 09:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guideline as stated in URL above
Re: date to year and quarter [message #336300 is a reply to message #336285] Fri, 25 July 2008 09:57 Go to previous messageGo to next message
aarti81
Messages: 235
Registered: December 2007
Location: USA
Senior Member
Never belittle anyone for asking beginner-level questions or for their English skills.



anacedent wrote on Fri, 25 July 2008 09:14
http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guideline as stated in URL above

Re: date to year and quarter [message #336302 is a reply to message #336300] Fri, 25 July 2008 10:07 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
aarti81 wrote on Fri, 25 July 2008 16:57
Never belittle anyone for asking beginner-level questions or for their English skills.



anacedent wrote on Fri, 25 July 2008 09:14
http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guideline as stated in URL above



Format your post and don't use IM speak.

In addition, YOU know you use discover, how could WE know it?
There is a Discover forum, maybe it is moire appropriate to post it in this place? Oh wait, this is also in the guide.

Regards
Michel

[Updated on: Fri, 25 July 2008 10:13]

Report message to a moderator

Previous Topic: Using FTP in Report
Next Topic: Picture from DB
Goto Forum:
  


Current Time: Sat Nov 30 05:48:37 CST 2024