Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access-Removing decimals from number field

Status
Not open for further replies.

SalGal

Technical User
Nov 22, 2002
24
US
I know there has to be an easier way to do this. . .

I inherited a db that currently has a macro to pull data from one table, manipulate it, and place it in another table for reporting. One of the fields included is a number field, which contains values that are from one to four digits. They show decimal places (like 3.02, 56.14, etc.) Someone wants this table to list the values WITHOUT the decimal places, so there are currently about 20 update queries to change each decimal value to numbers without decimals. Is there a way to get rid of all the decimals at once without having a query for each value? One, it seems inefficient to do it this way, and two, if the values change the query doesn't work.

Thanks for any help!

SalGal
 
Maybe you could use the Int function in a query - this returns the whole-number (integer) part of a number. You may also want to consider the Fix function, which is very similar to Int but rounds negative numbers differently. [pc2]
 
Assuming numbers are always x.xx or xx.xx, int(yourfield*100) should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top