Microsoft KB Archive/86854

{| = Excel: Error When Extracting Conditional Dates with QE.XLA =
 * width="100%"|

Last reviewed: November 29, 1994

Article ID: Q86854 The information in this article applies to:
 * Microsoft Excel for Windows, version 4.0
 * Q+E for Windows, version 3.0a

SUMMARY
When extracting conditional dates from an external database using the QE.XLA in Microsoft Excel version 4.0, the error message &quot;Error In SQL Statement&quot; may be generated if braces ({}) are not included around the date values in the Criteria field.

MORE INFORMATION
With the QE.XLA add-in loaded, data from external databases can be extracted into a Microsoft Excel worksheet. When using the conditional operators <,>, >=,<= and <> with a date in a Criteria field, the error message &quot;Error In SQL Statement&quot; will appear if braces ({}) are not included around the date value. The QE.XLA for Microsoft Excel 4.0 does not add the required braces around the date before the query is passed to Q+E, thus creating a SQL syntax error.

Workaround
The ({}) braces must be entered manually around the date in the Criteria before the extract is executed.

Example:

DATE_FIELD >={8/11/92}

DATE_FIELD is the field heading in the Criteria.