If you are unable to create a new account, please email support@bspsoftware.com

 

Problem calling SQL server stored procedure with datetime parameters

Started by ssrs2cognos, 20 Dec 2017 02:18:39 PM

Previous topic - Next topic

ssrs2cognos

I have a stored procedure dbo.MySp(@From datetime, @To datetime)

In Analytics, I created a report, added a prompt page, created two "Date and time prompts " and named them Param_From and Param_To.

In SQL object, I set SQL syntax to "Pass-Through" and use this code

exec dbo.MySp #sq(prompt('Param_From','date'))#, #sq(prompt('Param_To','date'))#

it WORKS, but it ignored the time portion of the "Date and time prompts".

if I changed the code to

exec dbo.MySp #sq(prompt('Param_From','datetime'))#, #sq(prompt('Param_To','datetime'))#

then I get error UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Error converting data type varchar to datetime. (SQLSTATE=22018, SQLERRORCODE=8114)

I can't even pass validation. Aren't both Date and Datetime valid datatypes?