1、按年查询:select * from dbo.td_BBSBoardInfo where (year(BBI_DateTime) between 2006 and 2009)
按月、日查询只要将year 改为 month、data
2、按年月查询:select * from dbo.td_BBSBoardInfo where convert(varchar(6),BBI_DateTime,112) between 200606 and 200911
1、按年查询:select * from dbo.td_BBSBoardInfo where (year(BBI_DateTime) between 2006 and 2009)
按月、日查询只要将year 改为 month、data
2、按年月查询:select * from dbo.td_BBSBoardInfo where convert(varchar(6),BBI_DateTime,112) between 200606 and 200911