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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Tables to zero decimal places

Status
Not open for further replies.

RamziSaab

MIS
May 7, 2003
522
GB
I have imported excel tables into access where i can pull out the data that i need and then reexport it to excel. However i need a way to round all the values to zero decimal places in the tables so when i export them to excel there are no decimal places (default is two). I have already tried setting the format in the tables to 0 decimal places. But it only does it for access and gives me two decimal places if i export.

Any ideas?
 
Hi RamziSaab,

Formatting numbers does not change their values, just the way those values are displayed. You have two choices - run through your table and actually change the values (but they will still display with two decimal places by default in Excel - e.g. as 17.00) and/or change the formatting in Excel to match what you have in Access. I'm sure I can knock up some code if you need help with it - just ask.

Enjoy,
Tony
 
Hey,

I noticed on the tables i can change the field size to long interger which seems to get rid of the decimal places...i dont know if it rounds them or not. Is there a way to right a code or update query to make it do it automatically ??

Any help will be greatly appreciated
 
Hi RamziSaab,

if you change your field to Long (from Double or whatever) you will get a warning and Access will then round your values in the conversion. That might be enough for what you want.

Enjoy,
Tony
 
Yeah its exactly what i want but i have quite a few tables and they all have quite a few fields in them. Is there way to tell it to do it automatically for all numbers or to make a code...if so could u help with it.

RAmzi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top