Skip to main content

My record has an 'Adress' string field and the value like this:

'SNBR - 772178 SNME SSTTAB, SCITY SSTATE  SZIP_'

 Note that it has 2 whitespaces between 'SSTATE' and 'SZIP_'. However, this field when being shown on salesforce has reduced redundant whitespace. So when I copy this string and query again (using the LIKE operator), it doesn't return the value.

 

The problem is that I have thousands of records and cannot manually check every single of them. How could I write SOQL to query them without worrying about this mistake? Can anyone help me? Thank you!

1 个回答
  1. 2022年7月22日 08:06

    Hi Taun, 

     

    Try to create a formula field (don't display on page layout) and use SUBSTITUTE function to replace double spaces and all special characters then use that field in SOQL.