SMS: WQL Queries Fail When Using Datetime in the Format 19981201000000.000000+000 (214942)
The information in this article applies to:
- Microsoft Systems Management Server 2.0
- Microsoft Systems Management Server 1.2
This article was previously published under Q214942 SYMPTOMS
When running a WQL query using datetime as a criteria in the format 19981201000000.000000+000, the query fails with the error:
Generic Failure
To view detailed error information, click the More Information button and look under Properties. The detailed error information for this problem is:
Query Failed. SQL Err >> #241 Sev 16: Syntax error converting datetime from character string
CAUSE
WQL datetime format is not converted to Transact-SQL datetime format. Any WQL query against datetime fails. WQL requires the datepart keyword for this type of query.
WORKAROUND
A query using the standard WQL datetime format, such as below, would fail:
select * from sms_statusmessage where time="19981201000000.000000+000"
Instead, use datepart to build a successful query:
select * from sms_statusmessage where datepart(mm, time) = 12 and datepart(dd, time) = 1 and datepart(yy, time) = 1998
STATUS
Microsoft has confirmed this to be a problem in Systems Management Server version 2.0.
Modification Type: | Minor | Last Reviewed: | 6/14/2005 |
---|
Keywords: | kbBug kbpending KB214942 |
---|
|