In the MSDN
is clearly said that:
The date argument cannot be incremented to a value outside the range of its data type. In the following statements, the number value that is added to the date value exceeds the range of the date data type. The following error message is returned: "Adding a value to a 'datetime' column caused overflow."
And the example:
SELECT DATEADD(year,2147483647, '2006-07-31');
SELECT DATEADD(year,-2147483647, '2006-07-31');
which causes the error:
"Adding a value to a 'datetime' column caused overflow."
This seem right. But why I get the same error executing this SQL statement:
SELECT DATEDIFF(YY,'1013-12-12',DATEADD(YY,-300,getdate()))
more specific and only:
SELECT DATEADD(YY,-300,getdate())
datetime
is 1753 because that was the year after Britain adopted the Gregorian Calendar What version of SQL Server are you on? – WinsteadSELECT DATEADD(YY,-300,cast(getdate() as datetime2))
will work for you then. – Winstead