我有WHERE
条款:
Where Year(CreateDate) >= '2016'
and b.colors1 In ('Yellow','Red')
Or b.colors2 In ('Yellow','Red')
Or b.colors3 In ('Yellow','Red')
我只想返回CreateDate >= 2016
,但由于Or
声明,我得到的数据超出了'2016'。我怎样才能解决这个问题?
答案 0 :(得分:3)
试试这个,年份不是字符串
Where Year(CreateDate) >= 2016
and (b.colors1 In ('Yellow','Red')
Or b.colors2 In ('Yellow','Red')
Or b.colors3 In ('Yellow','Red') )