ID: Q126970
2.5x 2.60 | 2.5x 2.60
WINDOWS | MS-DOS
kbprg kbfixlist kbbuglist
The information in this article applies to:
When creating a crosstab query, if the third field (numeric field) is specified as STR(<third field>), an empty string is returned when the query is generated.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro version 2.6a for Windows and FoxPro version 2.6a for MS-DOS.
1. Create a table with the following structure:
Field Name Type Width
----------------------------
MYROWS Character 3
MYCOLS Character 3
MYCELL Numeric 3
2. Add the following data to the Table:
MYROWS MYCOLS MYCELL
----------------------
A A 1
A B 2
A C 3
B A 4
B B 5
B C 6
3. Create a crosstab query by typing "Create Query XTAB" (without the
quotation marks) in the Command Window. In the resultant RQBE, click
Fields. Then in the Select Fields dialog, click the Cross Tabulate box.
Run the query and you will get the correct output.
MYROWS A B C
--------------------
A 1 2 3
B 4 5 6
4. In the Select Fields dialog of the RQBE, remove MYCELL from the field
list. Type STR(MYCELL) into the function/expression section and move the
expression into the Selected Output list. Run the query and the
resulting cursor shows a blank or empty value in MYCELL:
MYROWS A B C
--------------------
A
B
Additional reference words: FoxWin FoxDos fixlist2.60a buglist2.50
buglist2.50a buglist2.50b buglist2.50c buglist2.60 2.50 2.50a 2.50b 2.50c
2.60 genxtab.prg
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: FxotherGeneral
Solution Type : kbfix
Last Reviewed: October 20, 1997