Microsoft KB Archive/138978

= PRB: Structure Contains Underscore When Running Crosstab =

Article ID: 138978

Article Last Modified on 2/11/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q138978



SYMPTOMS
When you run the Crosstab option in a query, special characters show up such as an underscore character for the name of the field. Special characters specified here are "~`!@#$%^&*+{}[ ]\"':;?/>.<,". This only happens if the special character is located in one of the fields of the table that is queried.



CAUSE
The reason this happens is that the Query Builder cannot place a special character in the structure of the query or table that is created when the query is run. The only special character that is allowed in the structure of a query or table is the underscore character. It takes the place of any of the other special characters when the crosstab creates a new field from the contents of the original field. For example, if a field in the table has a percent sign (%) in it and nothing else, the name of the field in the query or table will be C_. The C means character, and the underscore takes the place of the percent sign. If the field contains any regular character plus a special character, such as ABC#, the field name will be Abc_.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a table that consists of two character fields named Field1 and Field2.  Add three records containing this data:   Field1    Field2 Special  Data Special  Data Special  %   Create a query by using the Query Builder and add the two fields to the query in the Fields tab. Create a third field by using the COUNT function located in the Functions/Expressions box. Set it up as  COUNT(Field2). Note that the Cross Tabulate check box is not available until the third field is added. Be sure to select the Cross Tabulate check box when it becomes available.  Run the query, and look at the name of the third column of the Browse window. It should have the heading of C__. Exit out of the Browse window, and select the original table (on the Window menu, click View Window). Then Click the Browse button, and change the field containing the percent sign (%) sign to ABC*.</li> Run the query, and note that the heading of the third field is Abc_.</li></ol>

All special characters are replaced with the underscore character in the structure of the created query or table.

Additional query words: VFoxWin

Keywords: KB138978

-

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

© Microsoft Corporation. All rights reserved.