Excel: Error When Extracting Conditional Dates with QE.XLA

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 "Error In SQL Statement" 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 "Error In SQL Statement" 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.

REFERENCES

"Q+E for Microsoft Excel User's Guide," version 3.0a, included in Microsoft Excel version 4.00 pages 57-66


KBCategory: kbinterop
KBSubcategory:

Additional reference words: 4.00 qpluse 4 4.0a qe range


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" 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.

Last reviewed: November 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.