Solution:

In this case the problem is thatyou areattemptingtoconvertthe numeric to adatetime.

You are watching: Arithmetic overflow error converting expression to data type datetime

You requireto revolve yournumericinto a string first:

declare
yr_mnth_dt as char(8)) as datetime);At the time you attemptand convert a numeric form to adatetime, SQL Server attemptsto includethe numeric worth as the variety of days to the date01-Jan-1900. In thiscase this is attemptingto includecountless days, and sothe overcirculation error.

CONVERTthis can likewise percreate for you.

choose yr_mnth_dt = convert(datetime, convert(char(8),
yr_mnth_dt));Additionally, you cantransform the number to a string, afterwardsthe string to a day. But, i am offering an instance ofusingDATEFROMPARTS:

SELECT DATEFROMPARTS(
answeredAug 27, 2020Tushar Shuvro31.7k points

Your talk about this answer:

Your name to display (optional):
Email me at this address if a comment is added after mine:Email me if a comment is added after mine

Problem: I am having actually only elementary knowledge about Sql Server and Azure. I have actually obtained fundamental knowledge about Sql server and Azure from the obtainable online material. I desire to write a really standard query that must calculate the average, min, max, and also count. ... this component of programming so unable to understand the above error. Kindly guide me in addressing above Sql Server and Azure connected error.
*
askedJun 6, 2020Martin K6.6k points
Problem: The only various other areas i thought it might issue are: decimal (38,20) might this be the issue?
*
askedMay 3salim160.6k points
Problem: I am currently gaining this error and also i am totally shed as to what the problem is. I tracked the error dvery own to a watch and also completed a pick * statement from it and also i get that message. Now, the weird thing is is that this error has actually never before showed up on this check out prior to. It has constantly ran without any kind of worries and nopoints been adjusted so i am unsure as to what the issue is.

See more: Beach Hairstyles For Summer 2015, Hairstyles For Spring Summer 2015


*
askedApr 30salim160.6k points
*
askedJul 3Rada Gracelynn166k points
Problem: When I run code I acquire arithmetic overflow error converting expression data kind nvarchar. Someone aid me.
Problem: I am gaining this error : Arithmetic overcirculation error converting float to data kind numeric The component of code offering error: ISNULL(CAST(CAST(TOTAL_APPTS.APPT_CNT AS FLOAT) / TOTAL_RECS.PAT_CNT AS NUMERIC(3, 2)), 0) AS Any idea why this is happening ?
Problem : What is the best way for me to deal with this problem: Arithmetic overcirculation error converting money to data form numeric?
Problem: I am selecting and inserting information in one more table in SQL Server and gaining the following error as:Arithmetic overcirculation error converting money to data form numeric.How deserve to I identify which information resulting in this issue?