views:

32

answers:

1

I need to build a string from some columns into another column, the trailing zeros must be removed from month and day :

YEAR=2008;MONTH=1;DAY=1;ID=1021; ... etc

For the day piece I've used the TO_CHAR(D_RIC,'D') function to remove leading zeros. Is there a format option for months to remove starting zeros too ?

+3  A: 

"Fill Mode" (FM):

select to_char (datecol, 'FMMM') from mytable;
Tony Andrews
+1: I [learnt something new](http://www.sqlsnippets.com/en/topic-12346.html)
OMG Ponies
@OMG Ponies thanks for the link,it's very useful
Stefano