I came across an article on SQL Server Central written by Claudio Silva (b/t) discussing that you can’t do arithmetic operations on DateTime21 like you can with DateTime.

For example:

Old Way

OrderDate < GETDATE() -1

You need to do something like this:

OrderDate < DATEADD(dd, -1, @vOrderDate)

Original Article here

Leave a Reply

%d bloggers like this: