Home » SQL & PL/SQL » SQL & PL/SQL » how to get year and month from date ?
how to get year and month from date ? [message #20871] Thu, 27 June 2002 00:19 Go to next message
AnotherBlue
Messages: 28
Registered: July 2001
Junior Member
I wnat make group by month
so i mucst to get month from date
but i forget how to do it.
Anybody can give me a hand....
THX
Re: how to get year and month from date ? [message #20872 is a reply to message #20871] Thu, 27 June 2002 00:33 Go to previous messageGo to next message
llz
Messages: 14
Registered: June 2002
Junior Member
you can do like this :select to_char(datafield,'mm') ,
you will get month
Re: how to get year and month from date ? [message #20874 is a reply to message #20872] Thu, 27 June 2002 01:20 Go to previous messageGo to next message
AnotherBlue
Messages: 28
Registered: July 2001
Junior Member
THANK YOU.........
Re: how to get year and month from date ? [message #20881 is a reply to message #20872] Thu, 27 June 2002 04:46 Go to previous message
vivek
Messages: 59
Registered: October 2001
Member
Use the to_char function

To get the month
Select to_char(sysdate,'month') from dual;

To get the day
select to_char(sysdate,'day') from dual;

Hope this helps.

Regards
Vivek
Previous Topic: ORACLe-Error
Next Topic: Pl/SQL CURSORS
Goto Forum:
  


Current Time: Fri Apr 26 11:20:02 CDT 2024