The TRANSFORM() function does not format a calculated field properly in Visual FoxPro (172849)
The information in this article applies to:
- Microsoft FoxPro for Windows 2.6a
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Visual FoxPro for Windows 7.0
- Microsoft Visual FoxPro 8.0
- Microsoft Visual FoxPro 9.0 Professional Edition
This article was previously published under Q172849 SYMPTOMS
The TRANSFORM() function does not properly format a calculated field in the
Report Designer. However, this function properly formats a non-calculated
field in a report. In FoxPro 2.6 for Windows, the calculated field appears,
but the format is incorrect. In Visual FoxPro for Windows versions 3.x and
5.x, the calculated field appears as asterisks.
CAUSE
The TRANSFORM() function returns a character value. Because numeric
functions are applied to a calculated field, changing the field to a
character value causes erroneous results.
RESOLUTION
In FoxPro 2.6 for Windows, create a report variable to perform the desired
calculations and then format the report variable.
In Visual FoxPro for Windows versions 3.x and 5.x, just Sum the field and
check the Currency check box in the Format dialog of the field (it appears
under the Numeric category.) In the Format text box in the Report
Expression dialog of the calculated field, use the following to format the
output:
Of course, a report variable could also be used in Visual FoxPro.
STATUS
This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 1/31/2005 |
---|
Keywords: | kbprb KB172849 kbAudDeveloper |
---|
|