MySQL Forums
Forum List  »  Spanish

Re: Error 1064 al crear una funcion
Posted by: William Chiquito
Date: January 29, 2008 08:54AM

Hola Ruben,

Para simplificar un poco la funciĆ³n puedes usar TIME_FORMAT

Mi ejemplo:
DELIMITER $$

DROP FUNCTION IF EXISTS `GetHoraMinuto`$$

CREATE FUNCTION `GetHoraMinuto`(thora_turno DATETIME)
	RETURNS VARCHAR(5)
BEGIN
	RETURN TIME_FORMAT(thora_turno, "%H:%i");
END$$

DELIMITER ;

SELECT GetHoraMinuto(hora_turno) FROM turno;

Options: ReplyQuote


Subject
Views
Written By
Posted
13005
January 28, 2008 02:54PM
Re: Error 1064 al crear una funcion
4292
January 29, 2008 08:54AM
3491
February 02, 2008 03:07PM
2604
February 02, 2008 07:09PM
2990
February 02, 2008 08:05PM
2707
February 06, 2008 12:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.