So I'm trying to create a query using KQL where one of the parameters brings back items that fall under a certain date range - only items that got modified within the past 7 days. Here it is below:
query.QueryText = "(AssignedTo:'" + name + "' ContentType:'Task' StatusOWSCHCS:'Completed' LastModifiedTime>=\"this week\")
The objective is to bring back all tasks assigned to this specific person that were completed within the past week. The rest of the parameters are good to go, but the last doesn't work as intended.
this week is built in and while it works, it only considers the start of the week (so probably Monday or Sunday) not the week (7 days) before that task was last modified. I feel like there needs to be some sort of calculation to get this done, but something not hardcoded with actual dates (since it would widely vary between different tasks). What can I do to do this? Thank you in advance.