DELIMITER //

CREATE FUNCTION DateMonth ( date VARCHAR(8) )
RETURNS VARCHAR(5)

SQL SECURITY INVOKER
BEGIN
   DECLARE ret VARCHAR(5);
	   set ret = concat(substring(date, 3,2),'.',substring(date, 5,2)) ;
   RETURN ret;
END; //

DELIMITER ;