ORA-01481

Very simple and bizarre problem...
I am getting the error: "ORA-01481: invalid number format model"
on this statement:

select distinct to_char(a.TRADE_MONTH,'mon') from mytable a

the statement:

select distinct a.TRADE_MONTH from mytable a returns:

1
2
3
4
5
6
7
8
9
10
11
12

Any ideas why I am getting the error ?

Thanks,

LVL 4
marperAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
to_char( , 'mon') only works like that if the input value is a date and not a number.

This should work better:
select distinct to_char( to_date(  '01/' || to_char(a.TRADE_MONTH) || '/2000' , 'DD/MM/YYYY')  ,'mon') from mytable a
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.