How to @SQL filter an email date value

Hello,
I wanted to filter an email mail message from the get outlook activity. I wanted to set the date time to grab emails from the last day or even configure the filter for the past week, I want to be able to do dynamic values. I know i could use the [ReceivedTime] filter but I wanted to figure out how to do a query? Thanks in advanced i will attach a screenshot of my syntax so far
image

Hi @jazlyn.luben

Can you try the below query

Hope this helps!!

1 Like

Hi @jazlyn.luben

Try this:
For emails from the last day:

"@SQL= urn:schemas:httpmail:datereceived >= '" + DateTime.Now.AddDays(-1).ToString("MM/dd/yyyy") + "'"

For the past week:

"@SQL= urn:schemas:httpmail:datereceived >= '" + DateTime.Now.AddDays(-7).ToString("MM/dd/yyyy") + "'"

Hope it helps
Regards

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.