I've came across an odd problem while comparing dates (actually smalldatetime) in SQL Server. It seems like there is a 30 seconds offset/bias while comparing dates close to the end of the day:
This is correct:
But this is definitely not correct:
What is happening here? Is math broken?
The smalldatetime
type has a accuracy of one minute so the literal '2019-12-31 23:59:30' is rounded to '2020-01-01 00:00:00'.