I have a query that i want to use in another query to help extract certain records of a certain tour_depart date. But, the date I am looking for are the date(s) greater than tour_depart but less than 120 days.
Here is what I have:
select DISTINCT (tour_depart) from tbl_tour where BETWEEN tour_depart AND (tour_depart - INTERVAL 120 DAY)
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
Why not this
select distinct(tour_depart) from tbl_tour where tour_depart > date_sub(curdate(), interval 120 day)