数据库里面关于日期问题? 现在我数据库里面有个知道为日期类型:2009-08-08 00:00:00 我现在要查询8月份的所有字段,请问我的SQL语句该如何写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from table1where Date >= CONVERT(DATETIME, '2009-08-01 00:00:00')) and Date<=CONVERT(DATETIME, '2009-08-31 00:00:00')) select * from table1where DATEPART(Month, Date) = 8 month(字段名)可以获取到月份select * from table where month(thedate)=8 and year(thedate)=2009 搂上的正确,在数据库中,month:月year:年day;日期select * from yourtable where month(fieldname)=9 select * from 表 where convert(varchar(7),字段,120)='2009-08' asp.net网站过一段时间就重新编译了 asn.net 中使用ajax问题 求助一个正则表达式问题 我要做4个按钮,第一个是默认的,其余的可点可不点 设定DropDownlist的Selected属性无效,求助 DataView RowFilter当筛选的值为多行时,如何取第一行的值啊? 在线编辑UBB代码实现问题 CSDN的BLOG是采取那个BLOG提供商的? 为什么刷新页面button事件就被执行一次,怎么解决? ligerui弹出div关闭刷新问题 asp.net如何抓取登录后网页中的数据? QQ的smtp发不了邮件了
where Date >= CONVERT(DATETIME, '2009-08-01 00:00:00')) and Date<=CONVERT(DATETIME, '2009-08-31 00:00:00'))
where DATEPART(Month, Date) = 8
select * from table where month(thedate)=8 and year(thedate)=2009
month:月
year:年
day;日期select * from yourtable where month(fieldname)=9