Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

using decimals with the number data type

using decimals with the number data type

using decimals with the number data type

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

Hi jdgsr,

what type is the field??

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

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.


RE: using decimals with the number data type

Thanks for the information.  I am getting the right results now! Good man!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close