Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2679
  • Last Modified:

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,

0
marper
Asked:
marper
1 Solution
 
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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now