I am getting the max date for a specific field(shopNO). Would it be faster if I add another condition just to search for daily requests in the where clause?
MAX([RequestDate]) AS[Latest Date]
WHERE [ShopNo] = '111111'
can you please explain what you "mean" by .. !!!
Would it be faster if I add another condition just to search for daily requests in the where clause?
WHERE [ShopNo] = '111111' and
Any time you use functions .. it degrades performance
Max and Convert both will !!
If you can use > (greater than) its best !!!
Hope this helps
thank you @harishgg1, please check my other post
Yes, it should help a lot if you add a date check. Greater-than doesn't really work here, you need gt_eq.
The appropriate code would be something like this:
WHERE [ShopNo] = '111111' and RequestDate >= CONVERT(DATE,GETDATE())