Stop number field from rounding up

tempestes

New member
Local time
Yesterday, 16:38
Joined
Jan 18, 2011
Messages
9
Hello,

Anyone know how to format a particular field in my db so that it does not round up the number that is entered into it?

The related data will be entered into the form and it will be to record the number of hours...ie:

Project Manager Rate Hours

What it's doing now is if the PM is working for 300/hr for 30.5 hrs, it makes it 31, but I need it to be exact.

I've tried changing the formatting (at table level) to Standard, General Number, allowing only 2 decimal spots, but nothing has an effect when I go back to the form and enter a fractional hr entry.

It's currently set to Long Integer as the Hours field is also used in another field that adds up all the hrs and puts the total in so not sure if it has to stay at Long Integer.

These Hour fields also show up on some reports and I have Access 2007.

I imagine it's quite simple as was my question of yesterday (thank you again everyone!), but I only have so much hair left from trying to figure out that problem so asking the experts here so that I may keep the rest of my hair :rolleyes:

Thanks!
Lynne
 
Umm, your problem is that you have it set to Long INTEGER (an integer does not accept decimals - it is a WHOLE number).
 
"Umm, your problem is that you have it set to Long INTEGER (an integer does not accept decimals - it is a WHOLE number)."

Do I not need these fields to be set as Long Integer so the contents can be added up in another field?

If not, and I can change it without affecting the addition, should I set it to Double? Decimal?

Thanks!
 
Do I not need these fields to be set as Long Integer so the contents can be added up in another field?
You cannot use long integers if you want decimal places. That is Math 101. If you want decimals you need to use Single, Double, Decimal, or Currency. And you can add a long integer with a double, for example. They are numbers. But you can't put the result into an Integer type or else you will lose your decimals.

If not, and I can change it without affecting the addition, should I set it to Double? Decimal?

If it has to do with money then I wouldn't use the number datatype but instead I would use the Currency datatype (it is its own separate item in the datatype list). If you have a mix of things, then probably Double or Decimal (with a scale of 2) would be the way to go.
 

Users who are viewing this thread

Back
Top Bottom