Get Outlook Mail Messages: Condition is not valid (SQL Subject Filter Query)

I was trying to filter Outlook email with specific sender and subject contains specific phrase “ROC Fraud Mana”. However there was an error saying that “Condition is not valid”. My filter string is as below:

“[senderemailaddress]=’”+str_SenderEmail+"’ AND @SQL="“”" LIKE ‘%ROC%’ AND @SQL="“”" LIKE ‘%Fraud%’"

Where did I do wrong? Please help!

1 Like

@s3342050 Hope this Link helps you

I tried the solution mentioned in that topic and the result shown as above :frowning:

Hi @s3342050

Have a view on the thread!

Try changing the second AND to OR and give a try!


Hi @s3342050

Yours looks correct, very often it is the single and double quotes that are of the wrong format. Please could you try this and see if it works? Or try replacing all single and double quotes in Studio.
"[SenderEmailAddress]='"+str_SenderEmail+"' AND @SQL="""" LIKE '%ROC%' AND @SQL="""" LIKE '%Fraud%'"

I’ve tried your solution but it didn’t work :frowning:

I’ve tried your solution but it didn’t work…