Code: Select all
SELECT * FROM Tickets WHERE idTech=4 AND (AptDate='2007-02-07' OR (JobStat=0 AND STRCMP('AptDate','2007-02-07')<0)) ORDER BY AptDate,AptTimeThe query returns records with AptDate of 2007-02-07 regardless of value of JobStat.
There is a record, however, with a AptDate of 2007-02-06 and a JobStat=0 that this query is not returning.
What am I doing wrong?