SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM

Hi Robot Masters,

Does anyone have any idea why am I seeing this error? same query works on other part of project, here when date is passed through variable also it is throwing error and even when Null values are passed shows the same. Can anyone help please?

FYI: I have placed this execute non query inside Catch block of Try Catch, hope that is not an issue.

Thank you all in advance!

Hello @Rajesh_Shet,

Is the data source you are working with in the other part of the project different from the one you are having issues with?

Usually this happens if:

  • the underlying datetime column in the database is set to NOT NULL
  • and as the message states, the year exceeds what is shown in the message

Also, are the date formats aligning?
Example: 10/20/2021 (October the 20th) is a valid date in the US date format, but it will likely fail if you pass it as 20/10/2021 (20th of October) even if it’s a legal format in the APAC time zone.

1 Like

Yes it was happening because it was NOT NULL column plus , I missed to have that end time ( system.datetime.now) on that one sequence.

Thanks again! @AndyMenon

Sweet! Appreciate the update @Rajesh_Shet .

Happy Automating!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.