cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mrslyfox Regular Visitor
Regular Visitor

Arithmetic overflow error converting expression to data type int.

Hello, 

SQL statement:

 

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,@ToDate
select * from Print_Machines_All where ReportId = 110

No issues with SSMS
but PowerBI return Arithmetic overflow error converting expression to data type int.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-sihou-msft
Moderator

Re: Arithmetic overflow error converting expression to data type int.

@mrslyfox

 

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:

 

https://community.powerbi.com/t5/Integrations-with-Files-and/parameters-to-SP-or-Sql-query/m-p/58337

 

Regards,

1 REPLY 1
Moderator v-sihou-msft
Moderator

Re: Arithmetic overflow error converting expression to data type int.

@mrslyfox

 

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:

 

https://community.powerbi.com/t5/Integrations-with-Files-and/parameters-to-SP-or-Sql-query/m-p/58337

 

Regards,

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 250 members 2,850 guests
Please welcome our newest community members: