Hi,
I created LinkedServer in SSMS from MYSQL DB.
When i Execute below open Query its working Fine
SELECT * FROM OPENQUERY(MySQL,'call GASP_sales_aps(''2013-04-01 00:00:00'',''2013-05-01 23:23:59'')')
But my problem is when i declared variable and execute below am getting error
declare @dt_start datetime='2013-04-01 00:00:00'
declare @dt_end datetime='2013-05-01 23:23:59'
declare @op datetime
set @op='SELECT * FROM OPENQUERY(MySQL,call GASP_sales_aps(''+@dt_start+'',''+@dt_end+''))'
exec(@op)
"Conversion failed when converting date and/or time from character string."
Can anyone help me where am going wrong?