Re: Database theory and money

From: Bernard Peek <bernard_at_postar.com>
Date: Mon, 11 Sep 2000 22:12:45 +0100
Message-ID: <KLaI4eBNrUv5EwFh_at_btinternet.com>


In article <0D3v5.29946$E_6.11742167_at_news3.rdc1.on.home.com>, Chad <cthomas500_at_home.com> writes
>Thanks for the feedback. I am familiar with Date's book. This just happens
>to be the first system where I have had to deal with multiple currencies.
>I'm looking for a good reference on this topic.
>
>For the record, I would allways store the currency indicator, but never in
>the same column. This particular system does not need to compare values in
>this column against other values in this column.

If you only stored the number, without the currency, then you would have been breaking the rules of normalisation because the numeric values are from different domains. Even if you store the currency and the numeric value your database may be incomplete. What you may need is the USD value of the currency, which you can only know by recording the exchange-rate too.

You might even need to consider two different exchange-rates or more. One rate at which you bought the foreign currency and the rate when you sold it. Real-life situations can get a lot more complicated than that.

-- 
Bernard Peek
Not necessarily speaking for
Postar Ltd, 27 Sale Place, London W2 1YR
bernard_at_postar.co.uk
Received on Mon Sep 11 2000 - 23:12:45 CEST

Original text of this message