mercredi 28 janvier 2015

MySQL TRIGGER with test on minute datetime


I try to create a TRIGGER on MySQL 5.6. In this TRIGGER, I test if the minute of my Date is equal to 0, 15, 30 OR 45. So I test this :



IF (MINUTE(NEW.tb_date) IN (0, 15, 30, 45)) THEN
...;
END IF;


But it doesn't work... So I try :



IF (SELECT (MINUTE(NEW.tb_date) IN (0, 15, 30, 45)) > 0) THEN
...;
END IF;


With no succes... Have you an idea of the problem and how can i resolve it ?





Aucun commentaire:

Enregistrer un commentaire