Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello to all,

I want to get amount using my sql query but i want to display that value with + sign

How can i put that before my sql query..

For Exa:-

Amount i Get that = 20000

But i want to look like = +20000


Thanks Regards
Posted
Comments
Maciej Los 17-Jul-14 15:16pm    
Why? It's... not good practice.

1 solution

Just look into it, and try to understand.. :)

SQL
DECLARE @intVariable INT,@varcharVariable varchar(10)

--For interger variable 

SET @intVariable =2000
select '+'+convert(varchar,@intVariable) as Number

--For varchar variable

set @varcharVariable='2000' 
select '+'+@varcharVariable as Number



from table you can retrieve it like that... :)

SQL
select '+'+convert(varchar,amount) from TableName
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900