Select *
From OrderTable
Where CAST(lastActivity AS Date) = CAST(GETDATE() AS Date)
Above is what I am using right now. But I realized that if there has been a change to an order I would need to grab all instances of that OrderID not just the line where something was updated.
So for example, one order can have multiple items. Lets say 5, so in the Ordertable there are 5 rows with the same OrderID. If someone went back and changed something for one item the last activity date for that item row will be updated to today and then it will be pulled. But I want to be able to pull the entire Order if there is change in one item, (i.e pull all 5 instances of OrderID if one of the items has been changed). The itemid's are unique to an order just an fyi.