Microsoft KB Archive/310264

= ACC2002: Decimal Field Is Truncated When You View an Object in PivotTable and PivotChart View =

Article ID: 310264

Article Last Modified on 9/27/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q310264



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).



SYMPTOMS
When you view an object in PivotTable or in PivotChart view, the data in a decimal field is truncated after the decimal point.



RESOLUTION
Use a data type such as Currency, Double, or Single that supports decimal places.

-or-

Create a query that uses a data-type conversion function, such as CCur, CDbl, or CSng, to convert the decimal field to a different data type. Then, view the query in PivotTable or in PivotChart view instead of the table.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The Currency data type most closely matches the behavior of the Decimal data type, as far as internal storage. Both the Currency and the Decimal data types are scaled integer data types. However, the Currency data type is limited to 4 places to the right of the decimal point whereas the Decimal data type supports up to 28 places to the right of the decimal point. If you must store 4 or fewer digits to the right of the decimal point, use the Currency data type.

The Double and Single data types support decimal storage, but both are floating-point data types. Because decimal fractions do not always have exact binary equivalents, using a floating-point data type can result in rounding errors. Use these data types only if you must store more than 4 digits to the right of the decimal point.

Steps to Reproduce the Behavior
 Open the sample database Northwind.mdb. Create a new table in Design view.  Add the following fields to the table:   Table: Table1 Field Name: ID  Data Type: AutoNumber Indexed: Yes (No Duplicates)

Field Name: Amount Data Type: Number Field Size: Decimal Precision: 10 Scale: 4 Table Properties: Table1 PrimaryKey: ID  Save the table as Table1 . On the View menu, click Datasheet View.</li> Add the following records to the table: </li> On the View menu, click PivotTable View.</li> Drag the Amount field from the PivotTable field list to the Drop Totals or Detail Fields Here area.

Note that all digits after the decimal point have been truncated, and that the data is displayed as an integer value.</li></ol>

Additional query words: pra

Keywords: kbbug kbnofix KB310264

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.