mysql过滤时间段表单

Sql:

SELECT * FROM tb_test
where date >= date_format(:bdate,'%Y%m%d') and date <= date_format(:edate,'%Y%m%d')
ORDER BY b.date ASC;

 其中

:bdate为开始日期;

:edate为结束日期。

posted @ 2016-05-04 23:05  izhenyang  阅读(755)  评论(0)    收藏  举报