Reputation: 117
I have the following code that outputs the past 30 days entries from phpmyadmin SQL database. It does work and shows my past 30 days entries, but it also displays today's date entries, which I don't want. Is there any way, we could get all the past 30 days entries, excluding today's date? Hers's the code
("SELECT * FROM products WHERE date BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW()")
Upvotes: 1
Views: 145
Reputation: 13509
Try following query:-
SELECT * FROM products WHERE date BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND DATE_SUB(NOW(), INTERVAL 1 DAY)
Upvotes: 1