select * from 表 where date_format(日期,'%Y-%m-%d')='2014-04-01' 日期select * from 表 where date_format(日期,'%Y-%m')='2014-04' 月份select * from 表 where date_format(日期,'%Y')='2014' 年就是date_format(日期,'%Y-%m-%d') 这里的参数长短
网上搜一下
你前台页面是什么查询?是输入时间还是选择时间?