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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 simple money format

Author  Topic 

Gideon
Starting Member

15 Posts

Posted - 2002-06-25 : 20:33:54
This is a really simple one I think. I have a field that is Type money.

How do I select this with commas after every 3rd digit...eg 1000 returned as 1,000.

New to SQL Server......

nr
SQLTeam MVY

12543 Posts

Posted - 2002-06-25 : 20:47:07
select (convert(varchar(20), fld, 1)

see convert styles

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-06-25 : 20:50:22
CONVERT([CHAR or VARCHAR](n characters), Field,1) AS Field
e.g.
CONVERT(CHAR(11),AmountPaid,1)where AmountPaid = 15963.3600 will come out as 15,963.3600. You must allow a large enough string to accommodate data and placeholders or else truncation will happen.

Sarah Berger MCSD
Go to Top of Page
   

- Advertisement -