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


Add to briefcase

Difference between Money and (Float or Decimal) Datatype Expand / Collapse
Author
Message
Posted Wednesday, January 16, 2013 11:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: 2 days ago @ 4:08 AM
Points: 47, Visits: 74
What is the difference between Money and (Float or Decimal) Datatype. If we use Float or Decimal instead of Money, will we loose any functions..?
Post #1408159
Posted Wednesday, January 16, 2013 11:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 18, 2015 3:05 AM
Points: 123, Visits: 299
Money can take upto 5 decimal. Whereas, if you need > 5 decimal places for a value go for decimal(n,m)

______________________________________________________________________

Ankit
MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
"Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
You are already naked. There is no reason not to follow your heart.”
Post #1408161
Posted Friday, January 18, 2013 9:21 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 12:50 PM
Points: 1,061, Visits: 2,580
nagesh.prasad (1/16/2013)
What is the difference between Money and (Float or Decimal) Datatype. If we use Float or Decimal instead of Money, will we loose any functions..?


Money and Decimal are fixed numeric datatypes while Float is an approximate numeric datatype. Results of mathematical operations on floating point numbers can seem unpredictable, especially when rounding is involved. Be sure you understand the significance of the difference before you use Float!

Also, Money doesn't provide any advantages over Decimal. If fractional units up to 5 decimal places are not valid in your currency or database schema, just use Decimal with the appropriate precision and scale.


Jason Wolfkill
Blog: SQLSouth
Twitter: @SQLSouth
Post #1408970
Posted Wednesday, March 18, 2015 1:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 18, 2015 1:47 AM
Points: 1, Visits: 0
The Decimal, Double, and Float variable types are different in the way that they store the values. Precision is the main difference where float is a single precision (32 bit) floating point data type, double is a double precision (64 bit) floating point data type and decimal is a 128-bit floating point data type.

Float - 32 bit (7 digits)

Double - 64 bit (15-16 digits)

Decimal - 128 bit (28-29 significant digits)

More about.....Decimal vs Double vs Float

Lynda
Post #1669365
Posted Wednesday, March 18, 2015 1:52 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:12 AM
Points: 14,467, Visits: 12,458
wolfkillj (1/18/2013)
[quote]nagesh.prasad (1/16/2013)

Also, Money doesn't provide any advantages over Decimal.


Except when working with SSAS. Analysis Services doesn't know decimal, it only knows float and money. So if you need a precision less than 5, you better use money because it saves you a lot of expensive conversion (decimal to float) when SSAS is processing data.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1669367
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse