This looks incomplete buddy
The expression should be like
"[Subject] = ‘SUCCESS:’ AND [ReceivedTime] >= ’ " + now.AddDays(-2).ToString(“MM/dd/yyyy”) + " ’ "
Or may I know what subject we are trying consider here I mean the text we want to filter with
Actually, we are using this subject line: “SUCCESS: Blackrock4_to_Markit_PROD - for index_weights files”
In out look filter condition i am using the above expression,but it’s showing error
No worries but, can you clarify your question? You want to filter your emails by the subject ‘SUCCESS: Blackrock4_to_Markit_PROD - for index_weights files’ and date, correct?
If the subject is static, use “[Subject] = ‘Your Subject’ AND [ReceivedTime] >=’”+Now.AddDays(-2).Date.ToShortDateString+"’ AND [ReceivedTime] <= ‘"+Now.Date.ToShortDateString+"’"
If the subject varies each time except for the ‘success’ part then, use “[Subject] LIKE ‘Success %’ AND [ReceivedTime] >=’”+Now.AddDays(-2).Date.ToShortDateString+"’ AND [ReceivedTime] <= ‘"+Now.Date.ToShortDateString+"’"
I want to retrieve all emails from past two days with a particular subject. My subject comprises of two parts where one is fixed and the other is variable. Below is a sample subject
SUCCESS: Blackrock4_to_Markit_PROD - for index_weights files
Here the bold part is constant and rest is variable whose value will be stored in a variable lets say subject. I tried below expression in get outlook mail however it is failing. It would really help me a lot if you can help me with right expression.
“[Subject] LIKE ‘Success %’ - this part of the filter is not working for me. But if i use like “@SQL=” + “”“” + “urn:schemas:httpmail:subject” + “”“” + " like ‘%“+S_EmailSearchFilter+”%’ it is working. My problem is i need to use the date filter along with this and for date filter [ReceivedTime] >=’”+Now.AddDays(-2).Date.ToShortDateString+"’ is the working pattern
Change the order , first filter datereceived then check subject. EX : “@SQL=urn:schemas:httpmail:datereceived >=‘start date’ AND urn:schemas:httpmail:datereceived <=‘end date’ AND urn:schemas:httpmail:subject like ‘%Success%’”