Re: Should I use SQL data type money or decimal given .NET datatype is decimal?



On Sat, 14 Apr 2007 10:20:31 -0400, Nicholas Paldino [.NET/C# MVP] wrote:

Ronald,

Why disregard? Care to say what conclusions you came to?

Personally, I think that if you are going to store money values in the
database, then money is fine. However, if the table you are storing values
on is an intermediate table which will store values performed on money and
then have more calculations performed on those results, then you should use
decimal with a much larger scale.

For example, say you have a Product table, with a Price field which is
the price for the Product. This price should be Money.

Now, if you had an intermediate table, with an average of how much money
was spent per customer, then that field should be decimal, with a larger
scale. The reason for this is that if you use those averages as inputs into
calculations later, then you don't want a truncation of values before the
money values go into the calc.

But then again, maybe you do, it all depends on what the accuracy you
need. Personally, I like to have as many places as possible being stored
(given practical limitations) and used for my intermediary calcs and then
perform the final rounding when the results are presented back to the user.

I agree with you about the accuracy but what benefits can you derive seeing
as money only makes sense to 2-3 decimal points?

--
Bits.Bytes
http://bytes.thinkersroom.com
.



Relevant Pages

  • Re: Obama
    ... its own money, it uses US dollars. ... And that South American Country is Eucador. ... That's where they get the increased inflation from. ... There's probably some much slower "normal" increase in price ...
    (soc.retirement)
  • Re: Electric cars
    ... Clinton was partly responsible for the mess but the main Character was ... The Irish Lottery where a syndicate betting on a large range of numbers could never lose money and might win the jackpot. ... control theory and statistical decision making. ... You don't really believe the recent share price movements of UK banks represents anything real about their business do you? ...
    (sci.electronics.design)
  • Re: Refuting supply-side economics
    ... > movement of real capital between investments. ... > invests financial capital in some project, the money buys real things ... > of land in relation to other commodities like money. ... is less land available then the trade price of land will increase. ...
    (sci.econ)
  • Re: Detecting CPUs and cores
    ... Capitalist theory says you should raise ... your price to the point you start making less money because of the ... If you offer the same thing to B at a lower price B ... It will never fly unless you force it somehow, because customers will ...
    (comp.lang.java.programmer)
  • Re: Sale of Goods - do they have to stick to contract?
    ... Price quoted £266 Lead time given 7 weeks ... alternative but to cancel your order and refund the money you spent ... in the banking system) is this a legally binding contract and can ...
    (uk.legal)

Loading