PHP中csv导出三个月内的数据

WBOY
Release: 2016-06-23 13:49:23
Original
1126 people have browsed it

如题
我想的是算出三个月前的第一天到这个月的最后一天 
能取到三个月的第一天 然后应该怎么做啊


回复讨论(解决方案)

select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-%d')

select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-01')

select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-%d')

select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-01')



不是啊 我们用算法算的  就是一周内的


select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-%d')

select * fromtbl_namewhere date >= date_format(subdate(now(), INTERVAL 3 month), '%Y-%m-01')



不是啊 我们用算法算的  就是一周内的
通过这样进行算的 然后三个月内的咋算啊

date("Y-m",strtotime("-3 month"))."-01"; 三个月前的第一天

你都有算法了   三个月的不会么?   照葫芦画瓢整呗

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!