Groups | Blog | Home
all groups > sql server programming > august 2003 >

sql server programming : Convert Function


RG
8/28/2003 10:53:36 PM
Hello,

I have a float field called actual. I am trying to format it as I am
selecting it and I am not successful. The select is select convert(money,
actual, 1) from title. Supposedly, it should have yielded $xxx,xxx.xx,
insted it have me xxxx.xxxx . Could somebody tell me what I am missing?

Thanks in advance

Andrew J. Kelly
8/28/2003 11:35:15 PM
No that is when you convert from Money to char. Try this.

SELECT "$" + CONVERT(VARCHAR(12),CONVERT(MONEY,Actual),1)


--

Andrew J. Kelly
SQL Server MVP


[quoted text, click to view]

Dejan Sarka
8/29/2003 8:17:26 AM
Please do not post the same question to multiple groups.

--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]

AddThis Social Bookmark Button