why is my data getting rounded???

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
i have a field in my database table that is formatted as currency, to 2 decimal places. when i enter data in the table however, it displays the number to two decimals but rounds it to the nearest whole dollar amount. for example, if i enter 15.99 it changes it to 16.00. any idea why it is doing this, and how can i avoid it?

thanks,
kevin
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
had the data type initially set to number, using the currency format. i changed the data type to currency, and it now works fine (?)

kevin
 
Upvote 0
Yeah, Access is picky about data types. I just tried out a few variants to illustrate. Note: Decimals were left Auto in the field settings.
Book1
ABCDE
1DataTypeFieldSizeFormatEnterDisplay
2NumberLongInteger[blank]15.9916
3NumberDecimalCurrency15.9916.00
4NumberLongIntegerCurrency15.9915.00
5NumberLongIntegerFixed15.9916.00
6CurrencyN/ACurrency15.9915.99
Sheet1


The Currency data type is a scaled decimal, the others are binary. Bottom line, if you have currency values, use the Currency data type.

Denis
 
Upvote 0
thank you for the info - could you by chance recommend a good book that will help me with database design in access? i am fairly proficient in Excel and VBA, but feel like a fish out of water in Access - it's not that I'm not familiar with database design, and in fact I can write most of my own queries in SQL, but I am just not very familiar with the ins and outs of the Access program. was hoping you might know of a good reference that will help me in that dept.

thanks,
kevin
 
Upvote 0
I recently bought Access 2002 Inside Out by Helen Feddema. It's the best general Access text that I've come across so far. The Developer's Handbooks by Litwin, Getz and Gilbert are also good from the coding point of view but they won't give you much detail on database design as such. Another general DB book (great on the principles, without specifically covering any database product) is Database Design for Mere Mortals, by Mike Hernandez.
Note: This is my personal view. Others may have different feedback :)

Hope this helps

Denis
 
Upvote 0

Forum statistics

Threads
1,221,777
Messages
6,161,871
Members
451,727
Latest member
tyedye4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top