Trouble with decimal numbers

S

spidey3721

I am trying to get my table to accept a number with 4 decimal places; for
example, 1000.0004. Whenever I try to play with the Field Size, Format,
Decimal Places, Precision, etc... properties and try to save it it tells me
I have too many fields defined. Can somebody walk me through this ?
 
H

HSalim

if you are trying to use the Decimal Datatype, you need to specify both
precision and scale
precision = Total number of charachters left and right of decimal place and
scale = total chars after decimal place

so for your number you should have a precision of at least 8 and a scale of
atleast 4
Although the help file says that a decimal data type uses 12 bytes, it is
possible that, like SQL server,
it uses fewer bytes if you use a lower precision
in SQL Server (1 - 9 uses 5 bytes; 10-19 uses 9 bytes; 20-28 uses 13 bytes)

Narrowly specifying the precision could be a form of data validation, but
you must carefully consider the range of allowable values before you specify
a really low precision)

You could also use Currency as your data type if you need no more than a 4
decimal place accuracy.

HS
 
A

Arvin Meyer

spidey3721 said:
I am trying to get my table to accept a number with 4 decimal places; for
example, 1000.0004. Whenever I try to play with the Field Size, Format,
Decimal Places, Precision, etc... properties and try to save it it tells me
I have too many fields defined. Can somebody walk me through this ?

Change your datatype to either a Number-Double or to Currency. A Double
takes 8 bytes to store a number, but it will store a number with up to 15
floating places on either side of the decimal point. Currency also takes up
8 bytes with up to 15 places to the left of the decimal, and always 4 places
to the right.

Access allows 255 fields in a table and up to 2K characters in a row of
data. If you exceed either of those specs, you will get the error you
described.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top