Home » SQL & PL/SQL » SQL & PL/SQL » How to create month?
How to create month? [message #309807] Fri, 28 March 2008 23:11 Go to next message
tondapi
Messages: 99
Registered: August 2007
Location: usa
Member
Hi,

By using this query

to_char(summary date,'Mmm') i get Jan, That's fine.
My problem is how can i get Fed month by using above function.
User want to see the values like Jan-Feb,Feb-Mar,......Nov-Dec.

How can i get this one .Kindly help me.
Re: How to create month? [message #309808 is a reply to message #309807] Fri, 28 March 2008 23:20 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You needs to read & FOLLOW posting guidelines as stated in URL below
http://www.orafaq.com/forum/t/88153/0/
>User want to see the values like Jan-Feb,Feb-Mar,......Nov-Dec.
SELECT 'Jan-Feb' FROM DUAL
Re: How to create month? [message #309813 is a reply to message #309807] Sat, 29 March 2008 01:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
add_months
||

Regards
Michel
Re: How to create month? [message #309815 is a reply to message #309807] Sat, 29 March 2008 01:09 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
use add_months function

example:-
SQL> ed
Wrote file afiedt.buf

  1  select to_char(sysdate,'Mon')
  2  ||'-'
  3* ||to_char(add_months(sysdate,1),'Mon') from dual
SQL> /

TO_CHAR
-------
Mar-Apr


regards,
Re: How to create month? [message #309825 is a reply to message #309815] Sat, 29 March 2008 01:35 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
@mshrkshl
Don't put solution only hint or clue as requested in OraFAQ Forum Guide, "Responding to Posts" section:
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
Previous Topic: servererror trigger, can it hurt me?
Next Topic: UTL_FILE.FRENAME & INVALID_OPERATION
Goto Forum:
  


Current Time: Thu Feb 06 22:42:09 CST 2025