Microsoft KB Archive/100018
Article ID: 100018
Article Last Modified on 12/1/2003
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft FoxPro 2.5b
- Microsoft FoxPro 2.0
- Microsoft FoxPro 2.5b for MS-DOS
This article was previously published under Q100018
When you are selecting output fields in the Relational Query By Example (RQBE) tool, you can create a new field and specify a field heading. This heading will appear in the SELECT statement and the query will contain the new field with the heading. The query will later produce the desired results unless the RQBE window is saved and opened again, in which case the field heading for the new field will be dropped and FoxPro will substitute "Exp_<#>", where <#> is a number signifying the display position of the field.
If you need to make a change to an existing query, repeat steps 2-4 above, and remove "string" from the fields list.
This problem was corrected in FoxPro version 2.5a for Windows and in FoxPro version 2.5a for MS-DOS.
Steps to Reproduce Problem
- From the File menu, choose Open, and select the database to open.
- From the File menu, choose New, select Query, and then choose New.
- Select Fields.
- In the text box under the Function popup list, type the following:
"string" as Newfield
- Choose Move to add "'string' as Newfield" to the Selected Output list. Choose OK.
- Choose See SQL.
The SELECT statement will contain "'string' as Newfield" in the fields list.
- Choose Do Query. The query result will have a field titled "Newfield" containing the word "string" in every record.
- Save the query, close it, and reopen it. The Output fields list will now list just "'string'" NOT "'string'" as Newfield". However, the See SQL push button will still show "'string' as Newfield" and the query result will still label the field as "Newfield".
- Make any other change. Save the query. The field name will be dropped. Running the query will produce a field labeled "Exp_#" instead of "Newfield".
Additional query words: FoxDos FoxWin VFoxWin