SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



Know Your Data Expand / Collapse
Author
Message
Posted Thursday, March 24, 2005 3:11 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, November 07, 2008 7:59 AM
Points: 28, Visits: 3
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rcarlson/knowyourdata.asp


Post #170010
Posted Monday, April 04, 2005 10:34 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, November 05, 2009 12:49 PM
Points: 3,425, Visits: 493

Totally agree. Just had a similar task. I used multiplying by 1.00 and then used Convert to make the output look nice for the report

Convert(decimal(7,3),Orders*1.00/mytotal)

Yelena




Regards,
Yelena Varshal

Post #171865
Posted Monday, April 18, 2005 5:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 04, 2006 11:03 PM
Points: 2, Visits: 1

Article provides good insight. I found this issue while I was trying to write a big stored procedure to run complex calcualtions.

I did not know the adding or subtracting .0 technique .

I created temporary variables of decimal type and reassigned values to these variables and used them in my calculation. But adding .0 would have been far more simpler and efficient.

Raja

 

 

Post #175284
Posted Tuesday, April 04, 2006 7:52 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Saturday, November 21, 2009 1:33 PM
Points: 476, Visits: 294
Needs to add information about the problems with the proprietary MONEY and BIT data types. Needs to learn to use CAST() and not CONVERT() when coding.
Post #270849
« Prev Topic | Next Topic »


Permissions Expand / Collapse