0

I am trying to figure out how to select the previous 24 hours to run a cron job email notification. Basically, I want to check for which staff has not responded within 24 hours of the time the record was created. Any help would be appreciated.

SELECT * FROM `eventstaff` WHERE created >= DATE_SUB(NOW(), INTERVAL 1 DAY) AND status = "noresponse"

So for example

status     staffname  created               jobid
noresponse johndoe    2015-05-12 10:38:36   546
noresponse janesmith  2015-05-13 08:42:27   287

If I ran that query now at 10:58 on 5-13 it would skip janesmith and get johndoe. The janesmith would continue to be ignored until 8:42:27 on 5-14.

NUGGET
  • 61
  • 5

0 Answers0