Home > Archive > microsoft.public.sqlserver.server > June 2002 > Formating number in SQL Analyzer output (thousands separator)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Formating number in SQL Analyzer output (thousands separator)
John Gooch

2002-06-27, 6:25 pm


Hi,

I have a big stored procedure that takes several minutes to run to make some
calculations.
At certain points I have code like the following

Print 'Assets Total : ' + Cast(@TotalAssets as VarChar(20))

This makes an out put
'Assets Total : 4565432135.23'

As you see, there is no thousands separator ...

How can I achieve this output : 'Assets Total : 4,565,432,135.23' ??


Thanks in advance

Mikhail Berlyant

2002-06-27, 6:25 pm

declare @val as money set @val = 4565432135.23
select convert(varchar(30),@val,1)

Mikhail Berlyant
Data Integrator, Data Systems
Launch Your Yahoo!Music Experience http://launch.yahoo.com
Brainbench MVP for Visual Basic www.brainbench.com

"John Gooch" <johngooch7@yahoo.com> wrote in message
news:3D1BA436.9000800@yahoo.com...
>
> Hi,
>
> I have a big stored procedure that takes several minutes to run to make

some
> calculations.
> At certain points I have code like the following
>
> Print 'Assets Total : ' + Cast(@TotalAssets as VarChar(20))
>
> This makes an out put
> 'Assets Total : 4565432135.23'
>
> As you see, there is no thousands separator ...
>
> How can I achieve this output : 'Assets Total : 4,565,432,135.23' ??
>
>
> Thanks in advance
>



Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net