Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

In-DB Formula - SQL

L_T
8 - Asteroid

Hi All,

 

I have an SQL database and need to modify an existing column to remove all apostrophes from the strings. I am trying to use a formula in-DB, however I keep getting an error message. 

If I were to use a formula tool, the expression would be 

existing column: [abc]

[abc] --> replace([abc], "'", "")

 

Seems like I am doing something wrong with the SQL syntax, so any help would be appreciated!

 

Thanks  

1 REPLY 1
Christina_H
14 - Magnetar

With some trial and error, I got this to work to replace / with _

replace("abc",'/','_')

 

The field name needs to be in double quotes, and the strings to find and replace in single quotes.  In your case, since you're searching for single quotes I think you'll need 4 single quotes:

replace("abc",'''','')

 

 

Labels