| |

VerySource

 Forgot password?
 Register
Search
View: 649|Reply: 5

I want to automatically add a currency symbol to each attribute in this field

[Copy link]

6

Threads

11

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-2-22 10:30:02
| Show all posts |Read mode
select avg (price) as 'average_price'
from titles

I want to automatically add a currency symbol to each attribute in this field
For example
$ 12.30
How to add this $?

select '$' + avg (price) as 'average_price'
from titles
Can not do it
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-5-3 10:45:02
| Show all posts
select '$' + str (avg (price)) 'average_price'
from titles
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-5-3 11:30:01
| Show all posts
select '$' + rtrim (1) 'average_price'
from titles
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-5-3 12:15:01
| Show all posts
select '$' + rtirm (avg (price)) 'average_price'
from titles
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-5-3 12:45:01
| Show all posts
--try

select '$' + rtrim (avg (price)) as 'average_price'
from titles
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 China

Post time: 2020-5-3 20:30:01
| Show all posts
select '$' + RTRIM (CAST (avg (price) AS CHAR (20))) 'average_price'
from titles
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list