In an automation trigger, I am trying to use a custom where clause that looks like this:
HS_Request.sEmail not in (select distinct sEmail from HS_Request where custom20 = ‘something’)
This is to prevent the trigger from hitting customers who’ve had any request in the past where custom field 20 is equal to ‘something’.
However, I get the error: “syntax error at or near “;””. The error message gives me a position for the error, which is at the first single quote before ‘something’. For some reason I can’t compare a custom field to a string? The sql works when I change it to the following:
HS_Request.sEmail not in (select distinct sEmail from HS_Request where custom20 = 1::text)
so I am pretty sure the issue is with the quotations. I get the same problem when using double quotes. Anybody know whats going wrong?