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



Rad,

If you are storing intermediate calculation values in a table which are
monetary values, then you might want that accuracy when using those
intermediary values in further calculations. It wouldn't be until the end
where you want to apply the rounding.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Rad [Visual C# MVP]" <nospam@xxxxxxxxxx> wrote in message
news:1cm1hx2m8er1u$.dlg@xxxxxxxxxxxxxxxxxxx
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

  • Profitiablity of SPAM / UCE / bulk email ... correctness of calculations help needed!
    ... These calculations originate from my spreadsheet: ... successful money made money made money made Transmission CC approval money ... house assumed at Income HouseSpeed bits/sec 60 mul corr (raw) div: ... x offer) = 3.00 coeff 3 ...
    (sci.math.num-analysis)
  • Re: Tories to build maglev routes?
    ... According to some calculations. ... The general impression (from ... But the money it costs you isn't counted as "tax":) ... The was the NHS functions is very different in Scotland, or Wales, ...
    (uk.railway)
  • Re: we cant take it with us
    ... Assume I have property worth £2m all of which I am using. ... I would not know how to spend that sort of money so the charity ... The calculations aren't that difficult to play with in a spreadsheet. ... house will be worth when you die and when you will die. ...
    (uk.finance)
  • Re: GA bias in "general" insurance?
    ... The application of bonafide logic to real life is politically incorrect. ... Insurance companies make their money by doing calculations based on ...
    (rec.aviation.piloting)
  • 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)