Microsoft KB Archive/89686

{|
 * width="100%"|

PRB: &quot;Field0&quot; Appears in a Query But Not in the Source Table
'Article ID: Q89686

Creation Date: 28-SEP-1992

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1, 2.0, 7.0

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

The resulting Datasheet view of a query reveals that a field called Field (where n is a number, for example, Field0) exists, but you do not have a field by that name in the source table. The SELECT statement of this query includes an asterisk (*) to indicate that all fields should be displayed.

CAUSE

The resulting data set of a query cannot contain two columns with the same name. When you create an SQL statement with an asterisk as the result of dragging the asterisk from the field list to a column in the query grid, and then you include another field from the same table, there are in effect two fields with the same name. The first field is from the group of fields represented by the asterisk, and the second field is the one that was explicitly included in the query grid. Note that this could also occur if you try to add a field to the grid that is already there.

Rather than present an error message indicating that there are two columns with the same name in the view, Microsoft Access substitutes the name of the second and subsequent duplicate fields with Field.

RESOLUTION

If you want to have the datasheet display a more meaningful name than Field, do the following (the steps below assume that you have included an asterisk in the query grid and that you are ready to add the duplicate field):

  In the column of the query grid where the duplicate field is to appear, type the name of the heading you want to see in the datasheet followed by a colon. For example: "EmployeeName2:" Following the colon, type the name of the field value you want to appear in this column.

When you display the query in datasheet mode, the field will be displayed with the alias name given in step 1. Note that if the Caption property for the field has been set in the underlying table or in the query, its value may be used for the column heading instead of the alias.
 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; 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." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10 2.00 7.00 crosstab xtab

KBCategory: kbusage

KBSubcategory: QryOthr