using decimals with the number data type
using decimals with the number data type
(OP)
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.
RE: using decimals with the number data type
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
RE: using decimals with the number data type
Thanks for the information. I am getting the right results now! Good man!
regards,
John