I have found the below query in one our stored procedures
SELECT *FROM TABLE1
WHERE (CONVERT(DATE,DateTo) BETWEEN @wkstdate AND @wkenddate))
Since Usage of Functions
in where
clause may hinder the performance I have changed it as below,
SELECT *FROM TABLE1
WHERE DateTo BETWEEN @wkstdate AND @wkenddate
The result is same after changing the codes. But i am not sure whether both will give same result in all the time. Any Scenarios where the above codes bring different results?
(P.S: @wkstdate and @wkenddate are
DATE
values & DateTo is aDATETIME
value)
Appreciate Your Suggestions