请教高手:以下语句为什么没有结果?
select a.id,a.itemname,a.status,a.person.a.thisyear
from a,b
where charindex(b.name,a.person)>0 and
charindex(a.thisyear,cast(b.times as varchar(10)))>0 and b.uid=14 and a.id>0
select a.id,a.itemname,a.status,a.person.a.thisyear
from a,b
where charindex(b.name,a.person)>0 and
charindex(a.thisyear,cast(b.times as varchar(10)))>0 and b.uid=14 and a.id>0
b.shenbtime 为年-月-日 (比如2011-01-03)格式
怎样写b.shenbtime 包含 a.thisyear的条件?是用charindex()吗?
select year('2011-01-03')
/*
2011
*/