Skip to content

Instantly share code, notes, and snippets.

@joseparedespy
Created November 24, 2018 19:26
Show Gist options
  • Save joseparedespy/3ee71aa3dab6664f2385ee78c675e37d to your computer and use it in GitHub Desktop.
Save joseparedespy/3ee71aa3dab6664f2385ee78c675e37d to your computer and use it in GitHub Desktop.
DELIMITER //
CREATE FUNCTION verificarSolicitud(_fecha date, _idEmpleado int)
RETURNS BIT
BEGIN
DECLARE _result BIT;
IF (select COUNT(*) fROM solicitud WHERE Empleado_idEmpleado = _idEmpleado AND _fecha BETWEEN fechaDesde AND fechaHasta) > 0
THEN
SET _result = 1;
ELSE
SET _result = 0;
END IF;
RETURN _result;
END //
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment