Show records from now() till next 7 days in mysql

前端 未结 5 641
清歌不尽
清歌不尽 2020-12-29 07:22

I want to select rows from the datetime now till 7 days in the future, how can I do this? Read alot about the date function of mysql but cant figure it out, this is the MySQ

5条回答
  •  甜味超标
    2020-12-29 07:55

    I am also posting the query which worked for me

    where matchdate BETWEEN CURDATE() AND DATE_ADD(CURDATE(),INTERVAL 7 DAY) This worked if above example doesn't work then try this.

提交回复
热议问题