Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Microsoft Money
Microsoft Money
Rate Topic
Display Mode
Topic Options
Author
Message
mfinch4
mfinch4
Posted Friday, January 08, 2010 6:54 AM
Forum 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
tclemons
tclemons
Posted Friday, January 08, 2010 7:20 AM
SSC 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
tclemons
tclemons
Posted Friday, January 08, 2010 7:23 AM
SSC 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
Bru Medishetty
Bru Medishetty
Posted Friday, January 08, 2010 7:31 AM
SSCommitted
Group: General Forum Members
Last Login: Monday, February 11, 2013 8:27 AM
Points: 1,735,
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
mfinch4
mfinch4
Posted Friday, January 08, 2010 7:51 AM
Forum 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
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Friday, January 08, 2010 8:02 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 11:20 AM
Points: 31,437,
Visits: 13,752
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
goran.biljetina
goran.biljetina
Posted Friday, January 18, 2013 12:38 PM
Forum Newbie
Group: General Forum Members
Last Login: Yesterday @ 11:15 AM
Points: 9,
Visits: 32
well said, I agree 100%
Post #1409066
arnipetursson
arnipetursson
Posted Friday, January 18, 2013 12:56 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 2:55 PM
Points: 137,
Visits: 420
The money data type is not an MS construct.
It came over with the original Sybase SQL Server code.
Post #1409073
arnipetursson
arnipetursson
Posted Friday, January 18, 2013 1:02 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 2:55 PM
Points: 137,
Visits: 420
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 »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.