Access truncate number

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.
 
D

Duane Hookom

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.
 
R

Ron Weiner

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.
 
J

Jeff Boyce

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>
 
J

jknyc9

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!
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top