How to select data from today to 7 days later? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to select data from today to 7 days later?

I have a table which contains data. Table name book. Entity / column of table are : id, id_book, id_user, date_borrow, date_return I want to select date_return starting from today to 7 days ahead. SELECT * FROM `book` WHERE `book`.date_return BETWEEN CURDATE() AND CURDATE()+7 I've try with query above, but not works. What query is suitable for this situation???

30th Nov 2016, 3:49 PM
Fendi Septiawan
Fendi Septiawan - avatar
1 Answer
0
select*from book where DateCol between adddate(now(),+7)and now()-----------I think u try that concept...
30th Nov 2016, 4:30 PM
bikash panda
bikash panda - avatar