Does SQL Server optimize two ">" operations on same column Can SQL Server optimize the following:
DECLARE @id INT;
DECLARE @d1 DATE;
SELECT a, b
FROM t
WHERE id_column = @id
AND date_column &gt;= CAST(CURRENT_TIMESTAMP AS DATE)
AND date_column &gt;= @d1

Notice that there are two &gt; operators on the same column. Assuming that today is 2020-12-23 and d1 could be either 2020-12-20 or 2020-12-27, I was hoping that SQL Server would automatically use greater of the two dates... 2020-12-23 in the first case and 2020-12-27 in the latter. But I am not sure.
I tested it on a table in my database that has a date column.
https://www.brentozar.com/pastetheplan/?id=r1V9bJ-av

Looking at the query plan, in SQL Server 2019 Dev edition, what SQL did was, it scanned the current timestamp and the date specified and created a date range. Then it scanned my table to find the rows in that range (none).
At first I thought it was searching for a range between the two dates.

but when looking at the logical reads, I think what it did was search between &quot;CAST(CURRENT_TIMESTAMP AS DATE)&quot; and &quot;NOW&quot; which is a few hours. So I think SQL did exactly what you expect it to do, which is optimize the &quot;&gt;&quot; operation on the same column.
 Scan count 1, logical reads 4, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.
Furthermore, if I change the query to do an &quot;OR&quot; instead of an &quot;AND&quot;, I get 84 logical reads instead of 4 and many more rows returned on the index seek. Which indicates to me that SQL Server 2019 is smart enough to optimize the query with two &quot;&gt;&quot; on the same column.
https://www.brentozar.com/pastetheplan/?id=BkbGf1Wpw
Now that might not apply all the time depending on the complexity of your query or if you have many more conditions in your where clause. Testing it in your environment is the key.