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

sql时间问题
我现在表里有一个   时间字段   我想取到   当年当月的所有数据   怎么去   sql语句应该怎么写   谢谢大家   比如现在是   2007年7月

------解决方案--------------------
select * from table1 where datediff(m,时间字段,getdate())=0
------解决方案--------------------
select * from tablename where convert(char(10),datetime,120) between '2007-07-01 ' and '2007-07-31 '