In SQL Server 2019 I run the following code without error:
declare @d1 as datetime;
set @d1 = cast('1 Jan 1753 00:00am' as datetime);
select @d1 'date';
But when I run this code it fails:
declare @d1 as datetime;
set @d1 = cast('1 Jan 1752 00:00am' as datetime);
select @d1 'date';
Giving the error:
Msg 242, Level 16, State 3, Line 5
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The only difference is the first one is 1 Jan 1753, and the second is 1 Jan 1752.
Thank you for your time.