10 Replies Latest reply: Jul 1, 2015 6:06 AM by Alex Hamilton McLeod RSS

    Exclude values in SQL query

      So i have the below section in my script, as I am trying to exclude Firms with the name ICAP in. But my wildmatch function doesn't seem to work. Is wildmatch the best way of doing this?

       

       

      SQL SELECT Id,

        AccountId,

        Firm__c

      FROM Contact

      WHERE AccountId != NULL AND WILDMATCH(Firm__c, '*ICAP*')=0;

       

      I have also tried this, which also does not work

       

      SQL SELECT Id,

        AccountId,

        Firm__c

      FROM Contact

      WHERE AccountId != NULL AND NOT WILDMATCH(Firm__c, '*ICAP*');

       

      What am I doing wrong?