Hi all,
I have a currency field in my database, when I select data from that
column, I want it to right align.
Any help?This is performed in the client application. SQL Server sends back data
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
<riversmithco@.hotmail.com> wrote in message
news:1110819266.183608.268260@.z14g2000cwz.googlegroups.com...
> Hi all,
> I have a currency field in my database, when I select data from that
> column, I want it to right align.
> Any help?
>|||Which software do you use to display these values to the end users? Have you
considered researching the options on the client programming language or
report writer to see if they have provisions to support such alignment &
formatting functionality?
In SQL Server, such formatting requires you to do explicit type conversions
and padding up with spaces. For instance with a value like 123.45 you would
display it right aligned using a 10 character string value as:
DECLARE @.c MONEY
SET @.c = 123.45
SELECT RIGHT( SPACE(10) + CAST( @.c AS VARCHAR ), 10 )
Anith|||Tibor Karaszi wrote:
> This is performed in the client application. SQL Server sends back
data
But what if I am not using a client app, perhaps I am just running a
report from a sql query?|||Then use Anith's suggestion. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
<riversmithco@.hotmail.com> wrote in message
news:1110820375.127912.77870@.g14g2000cwa.googlegroups.com...
> Tibor Karaszi wrote:
> data
>
> But what if I am not using a client app, perhaps I am just running a
> report from a sql query?
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment