Q+E UAE with % Search on Date column With SQLServer DriverLast reviewed: November 3, 1994Article ID: Q76294 |
Summary:
Q+E version 3.0 will return an Unrecoverable Application Error (UAE) when you make a query using the wildcard "%" 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
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 "Null DB process Encountered". You must restart Windows.
WorkaroundYou 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/1987Records matching the WHERE clause criteria values are included in the results. Method #2:
WHERE SUBSTRING(CONVERT(CHAR(20),DATECOLUMN),8,4 = "1987"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 "1987". Method #3:
WHERE DATEPART(DATECOL,YY) = 1987YY 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 "intended use" of the features and can work with any of the DATETIME components.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |