I am trying to set a table up to display out of date tests. So, I have a test that is dated 28/01/2014
and the next test is due on 28/01/2015
. As of today's date, this is out of date.
My query looks like the following:
$expiry = date("Y-m-d");
$queryout = "SELECT appliances.*, tests.* FROM (appliances LEFT JOIN tests
ON appliances.ID = tests.Appliance) WHERE Cli_ID = '$useractiveid'
AND `Next Test Due` BETWEEN `Date Tested` AND '" . $expiry . "'";
I want the query to find tests that are out of date where the Next Test Due
is out of date.