Microsoft KB Archive/76294

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

Last reviewed: November 3, 1994

Article ID: Q76294 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 SQLServer driver.

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

Steps to Reproduce Problem

 * 1) Logon to SQL database and select a table that contains a date field.
 * 2) Select the date column.
 * 3) Choose the Add Condition button.
 * 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 the OK button.

You will receive an Unrecoverable Application Error message. More Information:

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

Workaround
You may 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.
 * }