Where statement with apostrophe within value

Leona
Contributor
May 31, 2022

Hi,

I am using Table Transformer macro with the SQL

Select * from T1 where T1.'Status' IN ("To Do", "Done", "Won't Do")

How do I include the apostrophe in "Won't Do" in the where clause? Thanks.

3 answers

1 accepted

2 votes
Answer accepted
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2022

Hi @Leona ,

Please try the following SQL query:

Wed 16-1.png

SELECT * FROM T1
WHERE T1.'Status' IN ("To Do", "Won"+ CHAR(39) + "t Do")

Wed 16-2.png

Hope this helps.

Leona
Contributor
June 1, 2022

Thank you @Katerina Kovriga _Stiltsoft_ this works!!

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2022

Hi @Leona ,

try to use double ' 

Example :

Select * from T1 where T1.'Status' IN ('To Do', 'Done', 'Won''t Do')

Leona
Contributor
June 1, 2022

Hi @Fabio Racobaldo _Herzum_ I tried the double '' did not work. :( thanks for replying.

0 votes
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 31, 2022

HI @Leona ,

 

If this is like SQL, you should be able to escape it. In this case, you maybe about to run single routes around the apostrophe.

 

-Ben

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events