日期:2014-05-19  浏览次数:20419 次

求,查询两个日期之间的记录方法
我目的是查询1950年——1966年这段时间出生的人的记录,
请问:我这么写:select   *   from   PeopleInfo   where   datediff(year, '1950-01-01 ', '1966-01-01 ')> 0   错误出在哪?具体要查询如何写?谢谢参与

------解决方案--------------------
select * from PeopleInfo where year(日期字段) > = 1960 and year(日期字段) <= 1956
select * from PeopleInfo where year(日期字段) between 1950 and 1966