Showing posts with label ofmy. Show all posts
Showing posts with label ofmy. Show all posts

Friday, March 9, 2012

displaying extra characters with COLUMN-defined number format?

Here's a tricky SQL question that has definitely driven me to the end of
my rope. I'm using Oracle 9i and I need to perform some simple
multiplication on a field and then display it with a percent sign using
the COLUMN command. Here's the code thus far:

COLUMN price format 9,999.99 HEADING 'Charged%'
SELECT pricecharged * .231 as price
FROM VT_examdetail

The output from this reads:

Charged%
---
23.10
34.65
34.65
...

The kicker here is that I need to add a percent sign to the right of the
output, so that it reads:

Charged%
---
23.10%
34.65%
34.65%
...

I thought I could do this by just adding "|| ('%')" into the SELECT
statement, but when I do this the decimal position defined in the COLUMN
command is lost. Does anyone know another way around this?

Thanks,
AlexOn Tue, 07 Oct 2003 08:58:56 -0700, Alex <raindogs_1@.yahoo.com> wrote:

>Here's a tricky SQL question that has definitely driven me to the end of
>my rope. I'm using Oracle 9i and I need to perform some simple
>multiplication on a field and then display it with a percent sign using
>the COLUMN command. Here's the code thus far:
>COLUMN price format 9,999.99 HEADING 'Charged%'
>SELECT pricecharged * .231 as price
>FROM VT_examdetail
>The output from this reads:
> Charged%
>---
> 23.10
> 34.65
> 34.65
>...
>
>The kicker here is that I need to add a percent sign to the right of the
>output, so that it reads:
>
> Charged%
>---
> 23.10%
> 34.65%
> 34.65%
>...
>I thought I could do this by just adding "|| ('%')" into the SELECT
>statement, but when I do this the decimal position defined in the COLUMN
>command is lost. Does anyone know another way around this?
>Thanks,
>Alex
TO_CHAR(number, '99.99') || '%'|||Hi,

You could do this:

select cast( charged as varchar(10)) + '%' from orders

Regards,
-Manoj|||"Alex" <raindogs_1@.yahoo.com> wrote in message
news:3F82E2C0.4030204@.yahoo.com...
> Here's a tricky SQL question that has definitely driven me to the end of
> my rope. I'm using Oracle 9i and I need to perform some simple
> multiplication on a field and then display it with a percent sign using
> the COLUMN command. Here's the code thus far:

Couple of comments, this is a ms-sqlserver forum, not Oracle.

However, the other answers should work.

But, I'd say you're going about this the wrong way. Formatting should be
done at an entirely different level than the DB.

> COLUMN price format 9,999.99 HEADING 'Charged%'
> SELECT pricecharged * .231 as price
> FROM VT_examdetail
> The output from this reads:
> Charged%
> ---
> 23.10
> 34.65
> 34.65
> ...
>
> The kicker here is that I need to add a percent sign to the right of the
> output, so that it reads:
>
> Charged%
> ---
> 23.10%
> 34.65%
> 34.65%
> ...
> I thought I could do this by just adding "|| ('%')" into the SELECT
> statement, but when I do this the decimal position defined in the COLUMN
> command is lost. Does anyone know another way around this?
> Thanks,
> Alex

Sunday, February 19, 2012

display properties

hi, i cant seen to change my color settings or the size of
my desktop. i dont know what my driver is and i have tried
installing others out of the list given on the win98 disk
and it isnt working, can somebody please help me out
because i cant view anyting in a higher resolution and i
cant access any programs, thanks.
This is a SQL Server newsgroup and has absolutely nothing to do with Windows
98 display problems. How about trying
microsoft.public.win98.display.general?
Good luck!
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"mike" <mickmckenna2003@.aol.com> wrote in message
news:126d801c442a9$8f43fbc0$a501280a@.phx.gbl...
> hi, i cant seen to change my color settings or the size of
> my desktop. i dont know what my driver is and i have tried
> installing others out of the list given on the win98 disk
> and it isnt working, can somebody please help me out
> because i cant view anyting in a higher resolution and i
> cant access any programs, thanks.