salix/db/routines/util/functions/quarterFirstDay.sql

9 lines
230 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`quarterFirstDay`(vYear INT, vQuarter INT)
RETURNS date
DETERMINISTIC
BEGIN
RETURN CONCAT(vYear,"-", ((vQuarter - 1) * 3) + 1, "-01");
END$$
DELIMITER ;