This question already has an answer here:
- MySQL SELECT last few days? 5 answers
How can i get this part of a query to fetch the values by timerange?
Example of a table:
select * from tablename where timeregister between '2017-01-11' And '2017-01-30';
How could i get the timeregister to be last 7 days? I was trying this:
select * from tablename where timeregister(NOW(), timeregister) <= 7;
</div>