Access truncate number

  • Thread starter Thread starter jknyc9
  • Start date Start date
J

jknyc9

Hello,

I am dealing with a field that is desc with age. I have decimal numbers
after the whole number that i would like truncated. Of course, i would
not like to have this number rounded up but instead keep the number as
is. For example.... 25.75 would be truncated to 25 .... is this
possible?

Thanks.
 
You can use the Int() function to round down any positive numbers. It isn't
clear whether or not you want to permanently update values in a table or
just display 25.75 as 25.
 
You want to use Int(25.75) or Fix(25.75) either of which will return 25.
the difference between the two functions is how they handle negative
numbers. Int() returns the first negative integer less than or equal to
number, whereas Fix() returns the first negative integer greater than or
equal to number.
 
It isn't clear from your description, but is there a chance you are storing
a person's "age"? If so, wouldn't that mean you'd have to update it every
day, to handle all the birthdays each year?

Or maybe I read too much into your post...

Regards

Jeff Boyce
<Office/Access MVP>
 
Thank you all for your help. I'm new to access so i'm not sure where i
would place that value "Int() function", "Int(25.75)" or "Fix(25.75)"
as all of you have described. These values are stored in "Tables", and
when i highlight the table, I then make changes within the "design
view". That is how i have been modifying the table values.

Where would i designate these Int() function values?

Once again, thanks!
 
If you want to permanently change the values, you create an update query
that would update your age field with:
Int([Your Age Field])
Since this is a Reports news group, you may only be asking to display the
integer portion of an age. If this is the case, add a text box to your
report and set its Control Source property to:
=Int([Your Age Field])
Make sure the name of the text box is not the name of a field in your
report.
 
Back
Top