views:

1088

answers:

3

I am selecting rows from a table, but some of the columns are a text type, but they always have numeric data in them. How can I format them as numbers?

e.g. column quantity heading 'Quantity' format 999,999

However, since the column in the table is text, the numeric formatting is ignored.

+1  A: 

You will need to TO_NUMBER the column in your query.

Steve Bosman
+1  A: 

To render with thousand seperators, you'll need to...

to_char(to_number(quantity), '999,999')
cagcowboy
A: 

Thanks Steve,

I can now have:

column quantity heading 'Quantity' format 999,999
select TO_NUMBER(quantity) as quantity from Sales

And I get a right justified report.

quamrana