Skip to main content
Tuan Tran (Data House) 님이 #Salesforce Developer에 질문했습니다

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일 오전 8: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.