Microsoft KB Archive/73297

{| = Q+E UAE with % Search on Date column With SQLServer Driver =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q73297

SUMMARY
Q+E version 3.0 will return an Unrecoverable Application Error (UAE) when you make a query using the wildcard &quot;%&quot; on a column containing DATETIME data with the SQL Server driver.

This occurs only with Q+E for Microsoft Excel for Windows version 3.0 dated 12-9-90.

Steps to Reproduce Problem

 * 1) Log on to the SQL database and select a table that contains a date field.
 * 2) Select the date column.
 * 3) Select Add Condition.
 * 4) In the Value box, type &quot;%/%/87&quot; or &quot;%%/%%/87&quot; (without the quotation marks) to find all dates in 1987.
 * 5) Choose OK.
 * 6) You will receive a UAE message.

MORE INFORMATION
A UAE will result whether you have the options DOS or SQL wildcards selected. After the UAE, if you try to log on to the SQL Server again, you will get another error message &quot;Null DB process Encountered.&quot; You must restart Windows.

Workaround
You can add any of the following WHERE clauses to your SQL query to find those records with dates that meet your criteria. Method #1:

WHERE DATECOL BETWEEN 1/1/1987 AND 12/31/1987 Records matching the WHERE clause criteria values are included in the results. Method #2:

WHERE SUBSTRING(CONVERT(CHAR(20),DATECOLUMN),8,4 = &quot;1987&quot; This function converts the DATE datatype to a 20 char text string and then extracts 4 characters starting at char #8 to use for comparison with &quot;1987&quot;. Method #3:

WHERE DATEPART(DATECOL,YY) = 1987 YY can be substituted with MM,DD,YY,HH,MI or SS The first option is probably easier to use and, if DATECOL is indexed, it will use the index and be faster. The second method allows you more flexibility for substituting the different date components, and will use wildcards. The third method is probably the best &quot;intended use&quot; of the features and can work with any of the DATETIME components.
 * }