0
select
sum(A.[usercount1]) as [2015-01]
,Sum(A.[usercount2]) as [2015-02]
from
(select
startdate
enddate
when '2015-01-31' > U.startdate and '2015-01-31' < U.enddate then count(username)
Else NULL
End as 'usercount1'
,
Case
when '2015-02-31' > U.startdate and '2015-02-31' < U.enddate then count(username)
Else NULL
End as 'usercount2'
FROM U
group by U.enddate, U.startdate, username, contract, u.email, region
)A
获取错误:将varchar数据类型转换为日期时间数据类型导致超出范围值。使用未来数据超出范围值时的情况
如何使用未来的日期?