If you want to improve performance, then you are doing it wrong. The filters that you are using won't use an index (if there exists one on COLUMN_NAME
) because you are applying a function to them. The right way to do it would be to compare that column directly against GETDATE()
(on this case). This is a better way:
SELECT *
FROM TABLE_NAME
WHERE COLUMN_NAME >= DATEADD(DAY,DATEDIFF(DAY,0,GETDATE()),0)
AND COLUMN_NAME < DATEADD(DAY,DATEDIFF(DAY,0,GETDATE()),1)