Bharat Patel Feb,08 2017
Try to avoid function (user defined or inbuild) in where condition of sql query as it is always overlook indexing created on tables and taking much longer time to execute in case of table having large number of rows (over million)
Have a look below query. How to avoid date range condition? I hope it may be helpful to you.
Query 1 : convert(date, getDate())
SELECT * FROM xyzWHERE convert(date, getDate()) = '2011-05-09'
Query 2 : Fixed with differnt way
SELECT * FROM xyzWHERE createddate >= '2011-05-09'AND createddate < dateAdd(d,1,'2011-05-09')