此查询工作正常:
select CONVERT(DATETIME, GroupAdminEffectiveDate, 101) from ExchangeSmallGroupEnrollment
group by GroupAdminEffectiveDate
并返回以下内容:
1900-01-01 00:00:00.000
2012-06-30 00:00:00.000
2012-07-01 00:00:00.000
2012-07-11 00:00:00.000
2012-07-23 00:00:00.000
2012-07-25 00:00:00.000
2012-08-01 00:00:00.000
2012-08-14 00:00:00.000
2012-08-26 00:00:00.000
2012-09-01 00:00:00.000
2012-09-03 00:00:00.000
但是,以下查询:
select CONVERT(DATETIME, GroupAdminEffectiveDate, 101) from ExchangeSmallGroupEnrollment
我得到以下错误:
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
有任何想法吗?非常感激。
更新:
询问:
select distinct GroupAdminEffectiveDate from ExchangeSmallGroupEnrollment
结果:
(empty string)
06/30/2012
07/01/2012
07/11/2012
07/23/2012
07/25/2012
08/01/2012
08/14/2012
08/26/2012
09/01/2012
09/03/2012