This is a migrated thread and some comments may be shown as answers.

Failed to convert parameter value from a DateTime to a Int32

1 Answer 485 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
Iron
James asked on 19 Apr 2019, 03:34 PM

I have a question that is frustrating me.  I am trying to get up a column chart using the following query

SELECT COUNT(conversation.id) as total_chats, 
       COUNT(lead.id) as total_leads,
       (SELECT SUM(total_visits) 
FROM site_visit INNER JOIN site ON site.id = site_visit.site_id 
WHERE [date] BETWEEN DATEADD(DAY, DATEDIFF(DAY, 0, conversation.conv_start), 0) AND DATEADD(DAY, 1, DATEADD(DAY, DATEDIFF(DAY, 0, conversation.conv_start), 0)) AND site.client_id = @clientId) AS total_visits,
DATEADD(DAY, DATEDIFF(DAY, 0, conversation.conv_start), 0) as date,
        site.client_id
FROM conversation LEFT OUTER JOIN lead on conversation.lead_id = lead.id
                  INNER JOIN site on site.id = conversation.site_id
WHERE site.client_id = @clientId and conversation.conv_start BETWEEN DATEADD(DAY, 1, DATEADD(MONTH, -6, EOMONTH(@date))) AND DATEADD(DAY, 1, EOMONTH(@date))
GROUP BY DATEADD(DAY, DATEDIFF(DAY, 0, conversation.conv_start), 0), site.client_id that runs properly in the query configuration tool and populates the design view as expected as evidenced in the attached screenshots.  But when I attempt to run a preview I get the error shown in the third attachment.

I have checked all of the parameters and don't understand why this error would be coming up.

Thanks you for helping me understand this error.

James Wallace

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 24 Apr 2019, 12:27 PM
Hello James,

From the screenshot with the error, I believe that somewhere in the Graph there is an Expression that expects Int parameter and a DateTime is provided instead. You can check whether DataBinding / Sorting / Filtering or any other property/functionality that can take Expressions is causing the error. 
You can also send us a runnable report demonstrating the issue to investigate locally.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
James
Top achievements
Rank 1
Iron
Answers by
Neli
Telerik team
Share this question
or