DELIMITER // CREATE FUNCTION DateMonth ( date VARCHAR(8) ) RETURNS VARCHAR(5) BEGIN DECLARE ret VARCHAR(5); set ret = concat(substring(date, 3,2),'.',substring(date, 5,2)) ; RETURN ret; END; // DELIMITER ;