Cannot Use a Function as a Condition in a Q+E QueryLast reviewed: November 3, 1994Article ID: Q79268 |
Summary:
The Select Add Condition command in Q+E is unable to process functions such as DATE or LEFT for the value in its dialog box. If a function is entered in the Value box, Q+E will try to interpret the text as the literal value, which may or may not be a valid query. In most cases, some type of invalid query warning will be displayed. To use this type of function in a query, you must add it through the Select SQL Query dialog box. For example:
SELECT Name, DateEntered, Amount FROM sales.dbf WHERE DateEntered = Date()More Information: Q+E checks to see if the value entered in the Add Condition dialog box is the same type or can be converted to the same type as the column that it is testing against. If it can convert it, then it will use that value; however, it will not calculate a formula entered there. So the LEFT function would indicate to Q+E that it should display all the records in which field is equal to the word "Left" followed by an open and close parenthesis.
ExampleA more complete example of how to use a function is as follows: Suppose you want to select the names of all the employees in EMP.DBF that were hired this month. In Q+E, the function (DATE()-DAY(DATE())+1) will calculate the first day of the current month. For this example, change the hire dates for the following employees in EMP.DBF to a day of the current month you are in:
Tyler Bennett John Rappl
DATE()-DAY(DATE())+1) You will get the Warning message: Missing separator in date field: To create the proper query:
Tyler Bennett 12/1/91 John Rappl 12/13/91Reference(s): "Q+E for Microsoft Excel User's Guide," version 3.0, pages 12-14, 131-133
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |