ExamNotes.net  -  IT certification portal

ForumsCertResearchTop sitesNewslettersFree email
HomeRegister
Exams Notes
Practice exams
Exam games
Questions by email
Online training
Training videos
College degrees
Boot camps
Book store
Links directory
Tell a friend
For webmasters

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






This is interesting: Free IT Magazines | Databases help forum



General discussions > Public newsgroups > microsoft.public.sqlserver.server > Numeric Comma Separators

Show a Printable Version
Email This Page to Someone!
Receive updates to this thread






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

Old Post 12-11-02 03:24 PM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 12-11-02 04:24 PM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 12-11-02 04:24 PM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 12-11-02 04:24 PM
Reply w/Quote Edit/Delete Message IP: Logged
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

Old Post 07-01-03 12:39 PM
jonreade is offline Click Here to See the Profile for jonreade Click here to Send jonreade a Private Message Add jonreade to your buddy list Find more posts by jonreade Reply w/Quote Edit/Delete Message IP: Logged
All times are GMT.
Post new thread   Post reply

Featured site: MCSE, MCSD, CompTIA, CCNA training videos



Forum Jump:
Rate This Thread:
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


Powered by: vBulletin 2.2.8
Copyright ©2000, Jelsoft Enterprises Limited.

  Free Braindumps | mcse braindumps