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

9 lines
230 B
SQL

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 ;