0
我正在嘗試將一個mysql存儲過程鏈接到Microsoft SQL Reporting Server。 它提出了一個語法錯誤。我相信這是Date_from和Date_to參數。查詢低於任何幫助,將不勝感激SQL Reporting Services中的MySql查詢的日期語法
DELIMITER $$
USE `mydb`$$
DROP PROCEDURE IF EXISTS `DTI`$$
CREATE DEFINER=`linkeduser`@`%` PROCEDURE `DTI`(IN date_from DATETIME,
IN date_to DATETIME)
BEGIN
SELECT title,gender,firstname,lastname,address1,town,postcode,dob,IF(co.start_date = '00-00-0000', '', CAST(DATE(co.start_date) AS DATE)) AS 'StartDate'
FROM cf_user AS us
JOIN ca_compliance AS co ON co.user_id = us.user_id
WHERE co.start_date BETWEEN date_from AND date_to;
END$$
DELIMITER ;