[dba-SQLServer] SQL Server 2008 Display Formatting Problem

Alan Lawhon lawhonac at hiwaay.net
Sat May 26 13:02:01 CDT 2012


I listed the code (verbatim) exactly as given in the book.  The only
difference (which is obvious) is the section involving the 50 percent
calculation where I substituted a CONVERT function to try and change the
display of the values in the "Payment" calculated field for the records that
fall into the 50 percent payment catagory.  When you're displaying monetary
values in the result set, it doesn't make a lot of sense for a value such as
$123.45 to display as 123.452349, so I was attempting to convert the
123.452349 value to a character string that displays as $123.45.

I'm a little confused about data types, but I'll figure this out eventually.

Alan C. Lawhon

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart
Sent: Friday, May 25, 2012 6:01 PM
To: Discussion concerning MS SQL Server
Subject: Re: [dba-SQLServer] SQL Server 2008 Display Formatting Problem

Because you have used it incorrectly?

To use a expression commonly found in programming forums: 
"Code Not Shown!"

Post the problem line(s) and we are more likely to be able to help.


On 25 May 2012 at 17:41, Alan Lawhon wrote:

> I modified the code (slightly) from what is given in the book.  In the 
> section of code that calculates a 50% payment, I used the CONVERT 
> function to try and modify the output display of the "Payment" 
> calculated field.  (I wanted the calculated value of 3470.1250000 to 
> display as character string
> 3,470.13 so that it looks more "money" like.)  However, the CONVERT 
> function is not working as I expected.
> Does anyone have an idea as to why the CONVERT function is not working 
> as expected?
> TIA,
> Alan C. Lawhon
Stuart McLachlan

Ph:    +675 340 4392 
Mob: +675 7100 2028
Web: http://www.lexacorp.com.pg

dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com

More information about the dba-SQLServer mailing list