I am currently trying to link a mysql Stored Procedure to a Microsoft SQL Reporting Server. It is coming up with a Syntax error. I believe this is down to the Date_from and Date_to Parameters. The query is below any help would be appreciated
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