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

Microsoft Money Expand / Collapse
Author
Message
Posted Friday, January 8, 2010 6:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 19, 2010 11:49 AM
Points: 5, Visits: 17
We are trying to decide if we should use Money or Decimal(9.2) for our currency columns and are wondering why MS created Money datatype if decimal produces more accurate results?
Post #844257
Posted Friday, January 8, 2010 7:20 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, September 24, 2010 6:57 AM
Points: 41, Visits: 8
if i am not mistaken the money type placse the $ infront of the number where as decimal does not
Post #844286
Posted Friday, January 8, 2010 7:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, September 24, 2010 6:57 AM
Points: 41, Visits: 8
after looking it does not put the $ inf ront of the number but try this little script and then rethink your question.

declare @int money
declare @int2 decimal(9,2)

set @int = '88.5555555555555666666666666'
set @int2 = 88.55555555555556666666666666
select @int, @int2

which is more accurate
Post #844291
Posted Friday, January 8, 2010 7:31 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, February 11, 2013 8:27 AM
Points: 1,646, Visits: 1,947
Quoting Books online..

The money and smallmoney data types are accurate to a ten-thousandth of the monetary units that they represent.

Ans it does not represent currency symbol...



Bru Medishetty

Blog -- LearnSQLWithBru

Join on Facebook Page Facebook.com\LearnSQLWithBru

Twitter -- BruMedishetty
Post #844306
Posted Friday, January 8, 2010 7:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 19, 2010 11:49 AM
Points: 5, Visits: 17
What is being presented to me is the following SQL:

DECLARE @dOne DECIMAL(10,2),
@dThree DECIMAL(10,2),
@mOne MONEY,
@mThree MONEY,
@fOne FLOAT,
@fThree FLOAT

SELECT @dOne = 1,
@dThree = 3,
@mOne = 1,
@mThree = 3,
@fOne = 1,
@fThree = 3


SELECT @dOne = @dOne/@dThree*@dThree ,
@mOne = @mOne/@mThree*@mThree ,
@fOne = @fOne/@fThree*@fThree

SELECT @dOne AS DecimalResult,
@mOne as MoneyResult,
@fOne as FloatResult

produces DecimalResult = 1.00
Money Result = .999999
FloatResult = 1
Post #844338
Posted Friday, January 8, 2010 8:02 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 4:55 PM
Points: 31,278, Visits: 15,736
I've avoided money as I'm not sure if provides benefits over the numeric types. It also limits me, and I prefer to not be limited. I let the application handle the decisions on formatting and presentation.






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #844351
Posted Friday, January 18, 2013 12:38 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, February 28, 2014 4:15 PM
Points: 25, Visits: 48
well said, I agree 100%
Post #1409066
Posted Friday, January 18, 2013 12:56 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, November 20, 2014 3:37 PM
Points: 312, Visits: 951
The money data type is not an MS construct.
It came over with the original Sybase SQL Server code.
Post #1409073
Posted Friday, January 18, 2013 1:02 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, November 20, 2014 3:37 PM
Points: 312, Visits: 951
The results you are getting have to do with rounding rules.
They may be related to accounting rounding rules.
Post #1409074
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse