Solved

TO_CHAR - Tab in column when converting varchar2 field to currency.

Posted on 2012-04-05
2
452 Views
Last Modified: 2012-06-27
Gurus,

I'm noticing a tab in the column when converting a varchar2 field to currency. I'm using the TO_CHAR function to do this.

Select Distinct to_char(Prsprsc/100/2,0'999.99')
From Kat,Kav,Kvt,pro,art,aez,prs
Where
Kavkatkeyi = Katkeyi And
Artkeyi  = Aezartkeyi And
Prokeyi = Aezprokeyi And
Artkavkeyi = Kavkeyi And
Artkeyi = Prsartkeyi And
prskavkeyi = artkavkeyi and
prokatkeyi = katkeyi and
Kvtkeyi = Kavkvtkeyi And
Katpf7c = 'Jewel' And
(Artvf5c Like '%Deli%' Or Artvf10c Like '%DELI%') And
Prsvf15c = 'lb.' And
Kvtbezc In ('CHGO-78CA','DKLB-78CC','BNRM-78CE')
and artkeyi = 163245;

Returns
prsprsc = '   5.00'

Should Return
prsprsc = '5.00'

 
Seems simple enough but I'm obviously doing something wrong.

Help?
0
Comment
Question by:xbox360dp
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 37812984
actually that's a space reserved for the sign in case your number is negative


try this

to_char(Prsprsc/100/2,'fm999.00')
0
 

Author Comment

by:xbox360dp
ID: 37813691
Awesome Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question