我正在尝试将TSQL中的varchar字段转换为Date -
我得到的错误是以美国m / d / y mm / dd / yy格式将varchar转换为日期导致索引超出范围
这是我的查询
select *
from test_revision2
where test_revision2.location ='Downsview' AND
not exists (select 1
from test_bookings2
WHERE ((CONVERT(DateTime, startDate, 103) <= CONVERT(DateTime, '11/31/2017 00:00:01', 103))
AND (CONVERT(DateTime, endDate, 103) >= CONVERT(DateTime, '11/30/2017 00:00:01', 103)) and
test_bookings2.wsid = test_revision2.wsid));