I checked / compared the SQL statement several times, but it still doesn't work. I am using WorkBench 6.3 with MySQL. This gives me an error:
Syntax Error 1064: "IF" is not a valid input at this position.
IF(EXISTS(SELECT * FROM RECORDS WHERE FORMID = 200002016 AND TimeUploaded > '2016-07-17 03:13:39' AND TimeUploaded < '2016-07-17 03:13:39')) Begin SELECT TimeUploaded from RECORDS End;
source share