Outlook messages by subject and date


i want to get all messages from the past 7 days and with a specific email subject. I have the below for the subject which works fine but can’t seem to add the date part to it? thanks.

“@SQL=urn:schemas:httpmail:subject LIKE ‘%Your message couldn%’”


Have a look below thread.

1 Like

Still not working for me. Can’t seem to find a solution


Try with this expression

In filter property of outlook mail activity

“@SQL=(urn:Schemas:httpmail:subject LIKE ‘%your text%’) AND (urn:Schemas:httpmail:datereceived >= ‘ “ +Datetime.Now.AddDays(-7).ToShortDateString + ” ’)”

Hope this would help you resolve this
ensure you are tying this in your studio and pls don’t copy and paste from here as the direction of the single quotes will change in the expression

Cheers @fflattery

1 Like

Does this look okay to you?

Doesn’t seem to be working

Yeah it looks fine and i tried from my end
It’s working for me

Pls ensure that it is typed rather not copied pasted from here and if we do so the direction of the single and double quotes changes which will impact this

Cheers @fflattery

1 Like

Still can’t seem to get this to work. Would it have anything to do with the date format in outlook?
The format i have is in dd/MM/yyyy

managed to get it working. It was the format of the date that fixed it

“@SQL=(urn:schemas:httpmail:subject LIKE ‘%Your message couldn%’) AND (urn:schemas:httpmail:datereceived >= '” +Datetime.Now.AddDays(-7).ToString(“dd/MM/yyyy”) + “’)”

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