user3589006
user3589006

Reputation: 11

Date syntax for MySql query in SQL Reporting Services

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 ;

Upvotes: 0

Views: 485

Answers (1)

user3589006
user3589006

Reputation: 11

Only because no one seemed to want to help i managed to fix the issue my sell with this ="CALL sproc_PackOut('" & Format(Parameters!DateFrom.Value, "yyyy-MM-dd 00:00:00") & "','" & Format(Parameters!DateTo.Value, "yyyy-MM-dd 23:59:59") & "')"

Upvotes: 1

Related Questions