Jump to content

Showing records from previous 30 days


Crustyfur

Recommended Posts

ello,

 

I am struggling with date functions as always and need some help. I just want to show results from the last 30 days.

 

Thanks in advance.

 

C

 

SELECT COUNT(a.id), a.productid, p.productid, p.producttitle, p.productcode, p.manfid, m.manfid, m.manufacturer, DATE_FORMAT(a.datetime, '%D %M %Y') as a.datetime
FROM tt_gear_afflinks_data a, tt_gear_product p, tt_gear_manufacturer m 
WHERE a.productid = p.productid AND p.manfid = m.manfid AND a.datetime = CURDATE() >= 30 
GROUP BY a.productid 
ORDER BY COUNT(a.id) DESC LIMIT 20

Link to comment
https://forums.phpfreaks.com/topic/184520-showing-records-from-previous-30-days/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.