Hello Tom!
I'm an SQL "business user" building a simple data quality report...
I want to check whether last names contain "non-allowable" characters
CASE WHEN crm2check.NAME2 is null THEN null WHEN LENGTH(TRIM(TRANSLATE(UPPER(crm2check.NAME2), ' -ABCDEFGHIJKILMNOPQRSTUVWXYZ', ' '))) is not null THEN 0 ELSE 1 END as DQ_NAME2
Problem is how to allow apostrophes in names such as
O'Reilly or O'Dear !
Thanks, JimmyG
to put a single quote in a literal, you use two of them together
' -ABCDEFGHIJKILMNOPQRSTUVWXYZ'''
^^ that'll be a single quote really