mysql : Recieve data only per months
Posted
by Tristan
on Stack Overflow
See other posts from Stack Overflow
or by Tristan
Published on 2010-06-01T02:49:27Z
Indexed on
2010/06/01
2:53 UTC
Read the original article
Hit count: 262
Hello,
few times ago, i asked how to do to display datas per month, i must told a bad explanation because i just figured out that it's not what i want :
Here's what I got :
$req1 = ...
AND v.date > (DATE_SUB(CURDATE(), INTERVAL 2 MONTH))
AND v.date < (DATE_SUB(CURDATE(), INTERVAL 1 MONTH))
$req2= ...
AND v.date > (DATE_SUB(CURDATE(), INTERVAL 3 MONTH))
AND v.date < (DATE_SUB(CURDATE(), INTERVAL 2 MONTH))
But the problem, imagine that today you are the 10th june, it's going to calculate ALL the data between the
- 10 june to the 10 may
- then the 10 may until the 10 april...
But what i want is data :
- from 1st may to 1 st june,
- from 1st june to 1st july...
do you see what i mean ?
thank you ;)
© Stack Overflow or respective owner