dbTalk Databases Forums  

2003: Table Field Type For Beeeeg Decimal Numbers?

comp.databases.ms-access comp.databases.ms-access


Discuss 2003: Table Field Type For Beeeeg Decimal Numbers? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
(PeteCresswell)
 
Posts: n/a

Default 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-12-2010 , 12:55 PM






For dollar/cents amounts in the billions I've been going on the
assumption that Double is the only game in town.

Ditto share amounts in the billions with up to 4 decimal places.

Bad assumptions?
--
PeteCresswell

Reply With Quote
  #2  
Old   
David W. Fenton
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-12-2010 , 07:00 PM






"(PeteCresswell)" <x@y.Invalid> wrote in
news:l8d866920ehlg32thgcmkjmqr4m5emnrg3 (AT) 4ax (DOT) com:

Quote:
For dollar/cents amounts in the billions I've been going on the
assumption that Double is the only game in town.

Ditto share amounts in the billions with up to 4 decimal places.

Bad assumptions?
Er, isn't currency going to be able to hold that, too? It's only the
integer part that matters, right? According to the Access help file,
the max for currency is over 922 trillion.

If you have a client dealing in that kind of money, I wanna piece of
the job!

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #3  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-13-2010 , 08:16 AM



Per David W. Fenton:
Quote:
Er, isn't currency going to be able to hold that, too? It's only the
integer part that matters, right? According to the Access help file,
the max for currency is over 922 trillion.


In 2003, the only types I see are:
- Byte
- Integer
- Long Integer
- Single
- Double
- Replication ID
- Decimal

I was thinking maybe decimal, but it seems like I've tried it
before and ran into issues.

Quote:
If you have a client dealing in that kind of money, I wanna piece of
the job!
Big mutual fund outfits.

It's good work in that I'm such a miniscule piece of such a
humongous pie that they don't worry about the nickels and dimes
at billing time.

OTOH, mess up and put something bad into production and there's
Hell to pay.
--
PeteCresswell

Reply With Quote
  #4  
Old   
John Spencer
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-13-2010 , 09:02 AM



Currency is a separate choice for field type.

Those are all the number field types.

Currency is really a number field (Decimal with four places after the decimal
point)

Date(time) fields are another special case of a number (double) with the
integer portion representing the date and the decimal portion representing the
time of day.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

(PeteCresswell) wrote:
Quote:
Per David W. Fenton:
Er, isn't currency going to be able to hold that, too? It's only the
integer part that matters, right? According to the Access help file,
the max for currency is over 922 trillion.



In 2003, the only types I see are:
- Byte
- Integer
- Long Integer
- Single
- Double
- Replication ID
- Decimal

I was thinking maybe decimal, but it seems like I've tried it
before and ran into issues.

If you have a client dealing in that kind of money, I wanna piece of
the job!

Big mutual fund outfits.

It's good work in that I'm such a miniscule piece of such a
humongous pie that they don't worry about the nickels and dimes
at billing time.

OTOH, mess up and put something bad into production and there's
Hell to pay.

Reply With Quote
  #5  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-13-2010 , 07:42 PM



Per John Spencer:
Quote:
Those are all the number field types.

Currency is really a number field (Decimal with four places after the decimal
point)
Is currency subject to the floating-point arithmetic issues
where, if you query a few thousand records whose amounts actually
net out to zero, you can get something like .00000000043656
instead of zero?
--
PeteCresswell

Reply With Quote
  #6  
Old   
David W. Fenton
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-13-2010 , 10:15 PM



"(PeteCresswell)" <x@y.Invalid> wrote in
news:tgpb669mimbn038r801dhrq16eqvolae8h (AT) 4ax (DOT) com:

Quote:
Per John Spencer:
Those are all the number field types.

Currency is really a number field (Decimal with four places after
the decimal point)

Is currency subject to the floating-point arithmetic issues
where, if you query a few thousand records whose amounts actually
net out to zero, you can get something like .00000000043656
instead of zero?
No. Currency is accurate to 4 decimal places.

If what you're storing is MONEY, currency is the correct data type.

It is also a useful data type sometimes for non-monetary data when
the 4-digit decimal accuracy is helpful. But you then do have to
override the default formatting as currency.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #7  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-14-2010 , 09:41 AM



Per David W. Fenton:
Quote:
It is also a useful data type sometimes for non-monetary data when
the 4-digit decimal accuracy is helpful. But you then do have to
override the default formatting as currency.
That's what I was thinking for shares.

Has anybody actually done that?

I'm thinking maybe there might be some gotcha lurking....
--
PeteCresswell

Reply With Quote
  #8  
Old   
a a r o n . k e m p f @gmail.com [MCITP: DBA]
 
Posts: n/a

Default Re: 2003: Table Field Type For Beeeeg Decimal Numbers? - 08-17-2010 , 02:18 AM



with SQL Server, you can specify whatever type of decimal you want

alter table employees
add hourlyRate decimal(20, 10)




On Aug 14, 7:41*am, "(PeteCresswell)" <x...@y.Invalid> wrote:
Quote:
Per David W. Fenton:

It is also a useful data type sometimes for non-monetary data when
the 4-digit decimal accuracy is helpful. But you then do have to
override the default formatting as currency.

That's what I was thinking for shares.

Has anybody actually done that?

I'm thinking maybe there might be some gotcha lurking....
--
PeteCresswell

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.