Home » SQL & PL/SQL » SQL & PL/SQL » How to Extract Month from date column.
How to Extract Month from date column. [message #114710] Tue, 05 April 2005 05:21 Go to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

suppose

Date_Column
12-MAR-2000
16-APR-2005
04-JUN-2004

I want a quire which result.
MARCH
APRIL
JUNE

Wishes
Jawad
Re: How to Extract Month from date column. [message #114711 is a reply to message #114710] Tue, 05 April 2005 05:25 Go to previous messageGo to next message
pstanand
Messages: 133
Registered: February 2005
Location: Chennai,India
Senior Member
Hi use this. You will get the month name.
SELECT TO_CHAR(DATE_COLUMN,'MONTH')FROM <TABLE NAME>

Regards
pstanand
Re: How to Extract Month from date column. [message #114713 is a reply to message #114710] Tue, 05 April 2005 05:30 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9106
Registered: November 2002
Location: California, USA
Senior Member
scott@ORA92> column month format a5
scott@ORA92> select hiredate, to_char (hiredate, 'MON') as month from emp;

HIREDATE  MONTH
--------- -----
17-DEC-80 DEC
20-FEB-81 FEB
22-FEB-81 FEB
02-APR-81 APR
28-SEP-81 SEP
01-MAY-81 MAY
09-JUN-81 JUN
09-DEC-82 DEC
17-NOV-81 NOV
08-SEP-81 SEP
12-JAN-83 JAN
03-DEC-81 DEC
03-DEC-81 DEC
23-JAN-82 JAN

14 rows selected.

Re: How to Extract Month from date column. [message #114722 is a reply to message #114710] Tue, 05 April 2005 05:56 Go to previous messageGo to next message
ntnboi
Messages: 17
Registered: April 2005
Location: Italy - Rome
Junior Member

Hi,
You can use follow instructions:

select to_char(sysdate, 'Month') MONTH from dual;

MONTH
---------
April

Regards.
Re: How to Extract Month from date column. [message #114724 is a reply to message #114713] Tue, 05 April 2005 05:57 Go to previous message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Dear
Pstanand / Barbara Boehmer / ntnboi

Thanks for help and giving time.
It really worked.


I pray GOD will give you more knowledge.
Jawad

[Updated on: Tue, 05 April 2005 06:05]

Report message to a moderator

Previous Topic: how can we delete all the tables in a schema in one go without dropping the user
Next Topic: deleting duplicate rows....
Goto Forum:
  


Current Time: Sun Sep 14 04:17:22 CDT 2025