Email filter expression

Hi can someone help me to see what wrong with my filter expression as i getting the error as shown in the SS. I am trying to filter email received today and received the day before.
“@SQL=urn:schemas:httpmail:datereceived >'” +Today.AddDays(-1).ToString(“‘yyyy/MM/dd HH:mm’”)+ “’ AND urn:schemas:httpmail:subject LIKE ‘%VDM%’” —> this expression allow me to get email received today

“@SQL=urn:schemas:httpmail:datereceived <='” +Today.AddDays(-1).ToString(“‘yyyy/MM/dd HH:mm’”)+ “’ AND urn:schemas:httpmail:subject LIKE ‘%VDM%’”—> this expression allow me to received email from the previous day

I tried combining both but i got error , how should i write if i wan to merged both expression together ? Or how can write the expression if i wan to get email from both today and the previous day.

image

Thank you in advance

Hi,

There seems extra = at the following red arrow point. Can you try to remove it?

Also we might be able to remove single quote surrounding yyyy/MM/dd HH:mm

Regards,

I remove the extra = sign and single quote . tried run it but the process run and end immediately after pressing the play button

Hi,

Can you clarify your requirement?

@SQL=urn:schemas:httpmail:datereceived >'” +Today.AddDays(-1).ToString(“‘yyyy/MM/dd HH:mm’”)

And

@SQL=urn:schemas:httpmail:datereceived <='” +Today.AddDays(-1).ToString(“‘yyyy/MM/dd HH:mm’”)

will returns empty because the former returns mails after the date (yesterday) but the latter returns mails before the date (yesterday).

Regards,

I want to fetch all email received today and yesterday

I think it’s unnecessary to use @SQL=urn:schemas:httpmail:datereceived <='” +Today.AddDays(-1).ToString(“‘yyyy/MM/dd HH:mm’”) part

Doesn’t the following expression work as you expect?

"@SQL=urn:schemas:httpmail:datereceived >'" +Today.AddDays(-1).ToString("yyyy/MM/dd HH:mm")+ "' AND urn:schemas:httpmail:subject LIKE '%VDM%'"

Or it might be necessary to use universal time as the following.

 "@SQL=urn:schemas:httpmail:datereceived >'" +Today.ToUniversalTime.AddDays(-1).ToString("yyyy/MM/dd HH:mm")+ "' AND urn:schemas:httpmail:subject LIKE '%VDM%'"

Regards,

thank you , the one with universal timing work for me

1 Like

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