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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.