在单个单元格中的连接值之前和之后应用单个刻度标记

时间:2016-06-02 17:49:22

标签: excel sql-server-2008

我想在excel中连接值之前和之后组合单个刻度线。最终我需要将其传递给SQL查询

EX: 

Before-->pig, dog, bird, cat   cell A1

After-->'pig','dog','bird','cat'    cell A2 

Used For:

WHERE
a.Type IN ('pig','dog','bird','cat')

1 个答案:

答案 0 :(得分:0)

输入公式:

="'" & SUBSTITUTE(A1,", ","','") & "'"

enter image description here