Reputation: 11
I am trying to set an expression for command text like this:
="Database.dbo.pPROC 'FirstParameter', " + IIf(Parameters!Date.Value="","null", CDate(Parameters!Date.Value) )
and as a second parameter i need to pass Date/Time parameter from my report (Parameters!Date.Value)
to execute procedure.
The second parameter in sql has a smalldatetimeformat (f.e 2018-08-01 00:00:00)
.
Command works when I do not choose date (null) but when I want to choose date in report I have got an error as output:
"Error during processing of the CommandText expression of dataset ...."
Thank you
Upvotes: 1
Views: 1028
Reputation: 4100
Don't make things too complicated.
Instead of building a expression for the command text, chose Stored Procedure as the Query type. On the Parameters page of the Properties window, you can map the parameters of the stored procedure to report parameters or expressions.
Upvotes: 1