Friday, April 24, 2015

Displaying overdue PO's

I suggested to use the sargable query. Practically every time it is better to not use functions on the column but rather write conditions the way to compare the column with an expression. In this case the query engine can take advantage of the index on that column if it exists.

Did you use the condition with the CAST or not? I would expect the original condition with DATEDIFF be the same as new one with the CAST of CURRENT_TIMESTAMP.

Can you show dates in the 3 rows which you get with one query and not the other?


For every expert, there is an equal and opposite expert. - Becker's Law


My blog


My TechNet articles


No comments:

Post a Comment