ACC: Query with Expression on Expression Prompts for ParameterLast reviewed: May 28, 1997Article ID: Q119755 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you run a query, Microsoft Access prompts you to enter a parameter value even though you have not defined a parameter in the query.
CAUSEThis behavior can occur if you create a calculated field with an expression based on another expression on the query and this field has a sort order or criteria. Microsoft Access supports referencing column aliases only in other field cells. This can be seen most easily in the query's SQL view. The Select list can include expression names, but other clauses, such as Where and Order By, cannot.
RESOLUTIONThere are two ways to work around this behavior:
MORE INFORMATION
Steps to Reproduce Behavior
SELECT DISTINCTROW [Order Details].Quantity, 5*[quantity] AS Calc, [Calc]+20 AS Total FROM [Order Details] ORDER BY [Calc]+20;Note that the Order By clause includes the Calc expression, which is not allowed. To correct the sample query above, use either of the following methods:
REFERENCESFor more information about calculated fields in queries, search the Help Index for "Calculated fields," or ask the Microsoft Access 97 Office Assistant. |
Keywords : kbusage QryParm
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |