Q+E Macro Extract Returns Incorrect Records

Last reviewed: November 2, 1994
Article ID: Q67796

SUMMARY

The QE.XLM macro included with Microsoft's Q+E version 2.50 may not always extract the correct records when the criteria value is a date. For example, if the external database has a DATE field, and if ">9/13/85" (without the quotation marks) is placed in the criteria range, then the resulting external extract will only return records where DATE equals 9/13/85.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Excel and load the QE.XLM macro.

  2. From the Data menu, choose Set Source. Select Login and SQL Server, and choose OK.

  3. Input the appropriate Server Name, User ID, and Password. Choose OK and then choose OK again.

  4. From the Data menu, choose Set Owner. Choose OK. Select a table that has a DATE field. Choose OK.

  5. From the Data menu, choose Paste Field Names. Choose Paste All and choose OK.

    At this point, create the Criteria and Extract range in the normal manner.

  6. In the Date field of the Criteria range, input a date such as ">9/13/85" (without the quotation marks).

  7. From the Data menu, choose Extract External. Select either linked or unlinked. Choose OK.

Note that only those records that are equal to the criteria date are listed.

The Cause and Solution to the Problem

  1. From the Data menu, choose SQL query. Looking at the SQL query that is created for the extract, the WHERE clause would say:

          WHERE [date like 'Sep% 13 1985%'].
    

  2. From the Data menu, choose SQL query. To extract the correct records, the WHERE clause should say:

          WHERE [date > '9/13/85']
    

Changing the clause and then performing the SQL query returns the correct results.


KBCategory: kbother
KBSubcategory:



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 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.