PRB: AVERAGE Command Ignores SET DECIMALSLast reviewed: July 26, 1995Article ID: Q88238 |
The information in this article applies to:
SYMPTOMSIf the SET DECIMALS command is used to specify a certain number of decimal places for display and the AVERAGE command is then used to calculate the average value of a numeric field in a database, the average is displayed with a different number of decimal places than the specified value.
CAUSEThe result returned by the AVERAGE command contains the number of decimal places specified in the field definition of the database file structure.
RESOLUTIONTo obtain an average with the number of decimal places specified in the SET DECIMALS command, use the CALCULATE AVG() command.
MORE INFORMATIONFor example, consider a database that has a numeric field called SALES with two decimal places specified in the file structure. The SET DECIMALS TO 0 command specifies no decimal places in the result. Assuming that the average of the SALES column computes to 10,523.45, the AVERAGE and CALCULATE AVG() commands return different results, as follows:
AVERAGE SALES returns 10,523.45 CALCULATE AVG(SALES) returns 10,523Use the command that returns the desired number of decimal places.
|
Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |