won't show decimals (1 Viewer)

SueBK

Registered User.
Local time
Today, 22:25
Joined
Apr 2, 2009
Messages
197
I'm using Access 2003.

I have a table; pretty basic to capture the number of hours personnel work in a given week.

The 'hours' field is given me the pip. Details of the field:
Data Type: number
Field size: long integer (although I've also tried integer and decimal)
Format: standard (although, again, I've also tried general number and fixed)
Decimal places: 2

I want to enter hours as a decimal amount; ie 1.5 hours not 90 minutes and not 1 hour 30 minutes. At the moment (regardless of which combination of the above formats I use) I can not get it to show me the 0.5 or 0.25 etc. If I type "11.5" I either get 12.00 or 11.00 (can't seem to see a pattern as to which way it rounds). So, it is showing the decimal places, but not their values.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 23:25
Joined
Jan 20, 2009
Messages
12,849
Integer and Long Integer are ...well ...integers. Integers are whole numbers so can't have decimal places. The decimal places setting is ignored.

Decimal is a high precision format and must be set correctly to control the precision.

Use Single which is for real numbers. Really big numbers use Double.
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 01:25
Joined
Jul 15, 2008
Messages
2,271
I had same problem with trying to get interest rates to fix at 2 dec places and used Double as field size, Fixed as Format and 2 decimal places
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 23:25
Joined
Jan 20, 2009
Messages
12,849
I had same problem with trying to get interest rates to fix at 2 dec places and used Double as field size, Fixed as Format and 2 decimal places

Unless you are a really nasty loan shark you shouldn't need Double for Interest Rates. Single will suffice for over a trillion trillion trillion percent (3.402823E38) :D

He is an explanation of data types:
http://bytes.com/topic/access/insights/601315-vba-data-types

If you are really concerned about precision division use Decimal.
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 01:25
Joined
Jul 15, 2008
Messages
2,271
:eek: I just kept trying until I stumbled across one that worked.

Actually numbers on the RH side of the decimal are not as bad as the ones on the LH side:eek:
 

Users who are viewing this thread

Top Bottom