Jump to content

Need help pulling records for the last 7 days


eldan88

Recommended Posts

Hey Guys. I am trying to write a mysql query that just pulls the count for the last 7 days. I tried to run the SQL but it doesn't seem to be working. Do you guys have any suggestions? Thank you!

 

Below is my SQL syntax

SELECT COUNT(*) FROM checkout_page WHERE id = 1 AND DATE(checkout_date) < CURTIME() - INTERVAL 7 DAYS

Hey Bernard,

 

 Thanks for the post. I have tried that and I got the following error :(

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DAYS' at line 1

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.