tags:

views:

91

answers:

3

Hai,

From the database i want to take only month from the whole date format.While taking i'm getting the month as 08 for August and 09 for september etc.But i need to get the month as 8 for August and 9 for september etc.

How can i do it? Can any one help me?

+5  A: 
  select to_number(to_char(sysdate, 'mm')) from dual
Thilo
Thanks.It works
+2  A: 

This query returns 09:

select to_char(sysdate, 'MM') from dual

This query returns 9:

select ltrim(to_char(sysdate, 'MM'),'0') from dual
asalamon74
+2  A: 

Try this, does it with just one function call:

select to_char(sysdate, 'FMMM') from dual;

See Format Model Modifiers for details of the 'FM' syntax.

Tony Andrews