Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using decimals with the number data type

Status
Not open for further replies.
M

member 37483

Guest
I am trying to use the number data type with 2 decimal places to calculate a number of hours. Access keeps rounding the numbers off to the nearest number when I punch them into the table itself. I need the numbers to stay the same. Please tell me how. [sig][/sig]
 
Hi jdgsr,

what type is the field??

if it is a (float) double/single then you might be better off using a format specifier
#.0000

or setting the number of dp's to fixed and selecting the number of dp's manually in the property tab, access is a little strange in this department (percentage type is one i get strange results with so much so i use double type and code around it)

if the field is day/time it will likely store the decimal portion but display it rounded. you might be able to set a text box to have the date/time field as the source then set the format to suit.

date/time fields are nothing more then floats with the int portion being number of days and the decimal portion the number of hours/minutes/seconds past midnight
1/24/60/60 etc. you may be better off doing the time calcs from this angle.


HTH
Robert [sig][/sig]
 
Hi,
Thanks for the information. I am getting the right results now! Good man!
regards,
John [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top