salix/db/routines/srt/functions/dayMinute.sql

19 lines
339 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `srt`.`dayMinute`(vDateTime DATETIME)
RETURNS int(11)
NOT DETERMINISTIC
READS SQL DATA
BEGIN
/*
* Devuelve el numero de minutos absoluto diario
*
* @vDateTime Fecha a analizar
*
*/
RETURN HOUR(vDateTime) * 60 + MINUTE(vDateTime);
END$$
DELIMITER ;