











CompTIA
Exam Vouchers
Save money on CompTIA exams
| Question of the day
Sign up to receive
interactive practice questions
for MCSE, CompTIA
Cisco and other exams
| TestKing
Get MCSE, MCSD, CCNA, CCNP,A+, N+ and many more | * ExamSheets *
Guide for Success!
Actual Questions & Answers
MCSE, MCSD, A+ ,CCNA, CCNP
Oracle 8i, Oracle 9i Online practice tests
Certification sites Online university Online college Online education Distance learning Software forum Server administration forum Programming resources
|
|  |
| Author |
Numeric Comma Separators
|
Deane Barker
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Numeric Comma Separators
Is there any way to get SQL to format numbers with the comma
separator? For instance, a integer value in the database is...
100000
....but I want it to come from the SQL statement out as...
1,000,000
Is this possible? How about money: a float of 2.71 comes out as
$2.71.
Deane
Report this post to a moderator
|
|
12-11-02 03:24 PM
|
|
Jacco Schalkwijk
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Re: Numeric Comma Separators
That's something that is far better handled in your client application. Just
set the appropriate options in Access, VB or what other you might be using.
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Deane Barker" <deane@slingandrock.com> wrote in message
news:3ee9b2f.0212110813.46e22131@posting.google.com...
> Is there any way to get SQL to format numbers with the comma
> separator? For instance, a integer value in the database is...
>
> 100000
>
> ...but I want it to come from the SQL statement out as...
>
> 1,000,000
>
> Is this possible? How about money: a float of 2.71 comes out as
> $2.71.
>
> Deane
Report this post to a moderator
|
|
12-11-02 04:24 PM
|
|
Narayana Vyas Kondreddi
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Re: Numeric Comma Separators
CONVERT function can do this for you, is you pass money/smallmoney values.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server FAQ, articles, code samples, interview questions and more @
http://vyaskn.tripod.com/
"Deane Barker" <deane@slingandrock.com> wrote in message
news:3ee9b2f.0212110813.46e22131@posting.google.com...
> Is there any way to get SQL to format numbers with the comma
> separator? For instance, a integer value in the database is...
>
> 100000
>
> ...but I want it to come from the SQL statement out as...
>
> 1,000,000
>
> Is this possible? How about money: a float of 2.71 comes out as
> $2.71.
>
> Deane
Report this post to a moderator
|
|
12-11-02 04:24 PM
|
|
Anith Sen
Guest
Registered: Not Yet Location: Country: State: Certifications: Working on:
Total Posts: N/A
|
|
Re: Numeric Comma Separators
Like Jacco said, it is always recommended that you do all your
formatting in your client application. In T-SQL you can do:
DECLARE @intVal INT
SET @intVal = 100000
SELECT '$' + CONVERT(VARCHAR, CAST(100000 AS MONEY), 1)
--
- Anith
(Please respond only to newsgroups)
Report this post to a moderator
|
|
12-11-02 04:24 PM
|
|
jonreade
Junior Member M
Registered: Jul 2003 Location: Country: Afghanistan State: Certifications: Other Working on:
Total Posts: 1
|
|
Mmmmmmmmm, that's all very fine, but what if you're not coding up an app? Some people actually use SQL Server without VB (!!), for instance for creating a data feed. In such cases, formatting it through an app. would be an incredible waste of resources. 
Report this post to a moderator
|
|
07-01-03 12:39 PM
|
|
|
Featured site: MCSE, MCSD, CompTIA, CCNA training videos
Forum Rules: Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author.
Posts: HTML code is OFF. Smilies are ON. vB code is ON. [IMG] code is OFF. |
|
ExamNotes forum archive
|