Skip to content

How do i Query to Count Last 3 Days Recourds in MySQL?

One of my new Project, I need to Display Latest Updates of last 3 days. With MySQL’s date_add we can achieve result, see the below example.


 WHERE post_date >= DATE_ADD(CURDATE(), INTERVAL -3 DAY);
//SELECT * FROM posts a where post_created >= DATE_ADD(CURDATE(), INTERVAL -3 DAY);

Note that I’m using a negative date value. You can use a positive date value to get tomorrow, next week, next month, etc..

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments