3
I have a table with the following Rows:
- code (int)
- vaccine (varnish)
- dt_maturity (datetime)
I need a query to return all vaccines that will win in the interval of 10 days, counting today’s date.
I tried something like this I saw in that replySoen using INTERVAL
:
SELECT * FROM tblVacinas WHERE dt_vencimento >= DATE_ADD(CURDATE(), INTERVAL 10 DAY);
Obs.: didn’t work.
How would the query to return values in a given range from the current date?
Fetch last 7 days data from current date Detail you need to compare the correct units, use
date_format()
dt_maturity to specify the correct format (delete time, minute and seconds) to search.date
= year, month and day;datetime
= year, month, day, hour, minute and second.– rray
I think you meant Chris and not Chris.
– anonimo