感谢各位,不过除了hbwhwanghua(mikel),各位好象没注意我帖子中的要求,
select * from tablename where Birth >='1979-10-01' and birth < '1979-11-01'
为说明问题,暂把1979-10-01叫第1变量,1979-11-01叫第2变量。
回到应用程序开发环境中,不知各位用什么,就那DELPHI为例,我的思路是把EDIT1.TEXT的月份取出来(想让它是日期型,只有年月,让用户输入,不知是否可行?),再+1,但如果客户输入的是1979.12,第2变量会是1980-01吗?
我的思路可行吗?
select * from tablename t1
where birth =
(select t2.birth from tablename t2
where t1.birth = t2.birth
and convert(varchar,t2.birth,111) like '%'+'1978/10'+'%'
)