0

So I'm trying to query data extension Data123, and I want to grab all rows where Email_Address doesn't contain 'TEST'. I thought the proper syntax would be Select * from Data123 Where Email_Address NOT LIKE '%TEST%'. However, when I input this, I get

" An expression of non-boolean type specified in a context where a condition is expected, near 'Name'."

Not sure what the correct syntax is here? Unfortunately, I do not understand the SFMC SQL documentation: https://help.salesforce.com/articleView?id=mc_as_using_the_query_activity.htm&type=5

5
  • 1
    The query would be slow running, but your syntax looks fine. Is this the full body of your query or is this a redacted version? The error message doesn't seem fit.
    – Macca
    Sep 16, 2020 at 2:15
  • So this is my full original query:Select * From SendSummaryDER2SQL Where Email Subject NOT LIKE '%TEST%' Failure: An expression of non-boolean type specified in a context where a condition is expected, near 'Subject' Sep 16, 2020 at 18:39
  • I guess it's expecting the column 'Email Name' to be a Boolean value? At least from what I gather, it's saying that LIKE ... is a function that I can only utilize with Boolean values? Sep 16, 2020 at 18:42
  • 1
    Try putting square brackets around the "Email Subject" field to escape the space in the field name.
    – Macca
    Sep 17, 2020 at 1:22
  • That worked @Macca ! Thank you so much. So SFMC requires column headings to be inside [] , while values should be inside ' ' ? I wasn't aware of that. Sep 17, 2020 at 19:43

1 Answer 1

0

So Macca answered my question. My syntax looked fine, I just needed to input brackets around my Column name. So the correct query would be Select * From TableName Where [Column Name] NOT LIKE '%TEST%'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .