declare@FromDate datetime,@ToDate datetime,@startdate AS DATETIME = GETDATE()set @FromDate = DATEADD(MONTH, DATEDIFF(MONTH, 0, @startdate) , 0)set @ToDate = DATEADD(SECOND, -1, DATEADD(MONTH, 1, DATEADD(MONTH, DATEDIFF(MONTH, 0, @startdate) , 0) ) )exec pS_ST32_Machines_All 110, @FromDate,@ToDateselect * from Print_Machines_All where ReportId = 110No issues with SSMSbut PowerBI return Arithmetic overflow error converting expression to data type int.
Go to Solution.
Can you open SQL Profilter to check statement that passed to SQL Server when executing your SQL Statement? It may have issue when parsing the SQL statement in Power Query Advanced Editor.
Also I suggest you use query parameter instead of declaring variable in your statement. Please refer to a similar thread below:
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!