我在 sql server 2008 中有一个数据库表。我的查询因我不知道的原因而中断:
select release_id, url_id,tt_projectid, release_title, tech_area, current_state, dateadd(ss,last_built,'12/31/1969 20:00:00') as recent_Date,
autobuild_count, manualbuild_count, bcm_build_count, config_count, force_count, transition_only_count,
auto_integ_count,last_auto_integ,dateadd(ss,integ_complete_date,'12/31/1969 20:00:00') as integ_date
from tablename
where (auto_integ_count > 0
and MONTH(last_auto_integ) = '1'
and YEAR(last_auto_integ) = '2013')
and (release_id > 36000)
order by release_id desc
上面的查询工作正常,但是当我将 where close 的最后一行从 'and' 更改为 'or' 时,我得到了这个转换错误:
Conversion failed when converting date and/or time from character string.
我很困惑为什么要改变
'and (release_id > 36000)'
到
'or (release_id > 36000)'
会导致这样的错误