FIX: Crosstab Query Returns Empty String When STR() Used

Last reviewed: October 20, 1997
Article ID: Q126970
2.5x 2.60 | 2.5x 2.60
WINDOWS   | MS-DOS
kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5x, 2.6
  • Microsoft FoxPro for MS-DOS, version 2.5x, 2.6

SYMPTOMS

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.

STATUS

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.

MORE INFORMATION

Steps to Reproduce Problem

  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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.