We help IT Professionals succeed at work.

How to convert varchar2 field to currency field in Oracle??

xbox360dp
xbox360dp asked
on
Gurus,

I'm having trouble converting a varchar2 field to a currency field in Oracle.

Field1 = 050
Field2 = 1099

Select to_char(field1,'9,999.99')
From table;

Returns
50.00

I want it to return 0.50!  How do I accomplish this?

Select to_char(field2,'9,999.99')
From table;

Returns
1099.00

I want it to return 10.99!  How do I accomplish this?

Thanks!
Comment
Watch Question

SILVER EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
Divide the column by 100?

select to_char(1099/100,'999.99') from dual;

Author

Commented:
Awesome ... thank you sir!!!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.