Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how do i put a value inside a column

Author  Topic 

baxterstockman
Starting Member

6 Posts

Posted - 2011-03-01 : 15:53:51
hey, i got a table with column and money value, how do i put i the money sign inside a column. So example:

table1
column1
5
4
2.6

so what i want to get is, select column1 as column$ from table1:

table1
column$
5$
4$
2.6$

does anybody has an idea?
thank you

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-01 : 15:56:09
This is a presentation issue, not a SQL issue. Format the data in your application code not in the SQL query.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

baxterstockman
Starting Member

6 Posts

Posted - 2011-03-01 : 17:42:43
yeah, thats true, i know, but i use excel and in the excel sheet i got a button which changes the tables. so if i format one of these cells it shows the value of one case. so if you click the button (case two) it would still show the same value but thats not correct. in one case it should be $ in the other %. so is there a possibility to change change that in sql?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-01 : 18:03:35
Assuming your column is varchar

SELECT Column1 + '$' AS [Column1+$]
FROM Table1

And as Tara said, it's a presentation issue, but the less work "they" have to do, the better I feel



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-01 : 18:05:59
wait you want to display or inert data to/ from a table...it's been a long day

my question for the day

Why are front end developers allowed to design anything?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -