I want to get data from training_course table where current date minus 5 days is equal to training_end_date. Training_end_date is my field in the table. Thanks
Asked
Active
Viewed 50 times
-2
-
You should try to resolve it on your onw by ussing google or any other tools available on the internet and then ask for doubts on stackoverflow. – Noel Carcases Dec 08 '20 at 15:13
1 Answers
0
You seem to want:
select *
from training_course
where training_end_date = current_date - interval 5 day
Or, if your dates have time components, you maybe want:
select *
from training_course
where training_end_date >= current_date - interval 5 day and training_date < current_date - interval 4 day

GMB
- 216,147
- 25
- 84
- 135
-
Thanks so much, it works with the first one as I only need the day. – tsegay gebreselassie Dec 08 '20 at 14:47