I am making a Query for a project that I am working on. I have to make a query that shows me the dates from Today and the dates that will still come. At the moment my Query is this:
$query = "SELECT * FROM systeem
RIGHT JOIN vestiging ON vestiging.id = systeem.vestigingID
LEFT JOIN systeemMeldkamer ON systeemMeldkamer.systeemID = systeem.id
LEFT JOIN meldkamers ON meldkamers.id = systeemMeldkamer.meldkamerID
LEFT JOIN systeemContract ON systeemContract.systeemID = systeem.id
LEFT JOIN onderhoudsLog ON onderhoudsLog.systeemContractID = systeemContract.id
LEFT JOIN contracten ON contracten.ident = systeemContract.contractIDENT
WHERE onderhoudsLog.onderhoudsDatum LIKE '2017%'
ORDER BY onderhoudsLog.onderhoudsDatum ASC";
This Query will give me all dates that look like "2017%". Instead I want to get the date of today and every date that will come after the date of today:
today it is : 2018-03-05
The result that I want to get: 2018-03-05, 2018-03-06, 2018-03-07
Tomorrow It is: 2018-03-06 And then it has to search for all dates after 2018-03-06
I hope any one can help with my query! Don't mind the "LEFT JOINS", it is because I have to go through 6 tables so I can match the date for maintenance with the number if our customer.