DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`getDayExpeditions`() BEGIN SELECT e.expeditions_id as expeditionFk, date_format(e.odbc_date,'%Y-%m-%d') as expeditionDate, e.ticket_id as ticketFk, t.routeFk as routeFk FROM vn2008.expeditions e INNER JOIN vn.ticket t ON t.id = e.ticket_id WHERE DATE(odbc_date) = util.VN_CURDATE(); END$$ DELIMITER ;