0

I am trying to create a formula that will help me in creating sql query

In Excel this is what I have written down:-

=CONCATENATE("UPDATE T_KeyAttribute set description=",B3," WHERE KeyName=",A3)

This gives me for example:-

enter image description here

How can I add quotes around the values of B3 and A3 (i.e. around their text values)

Shad
  • 1,185
  • 1
  • 12
  • 27

2 Answers2

1
="UPDATE T_KeyAttribute SET description ='"&B3&"' WHERE KeyName = '"&A3&"'"

This will return:

UPDATE T_KeyAttribute SET description = 'Text1' WHERE KeyName = 'Text2'
Xyloz Quin
  • 178
  • 4
1

I like using CHAR(34). You might find other strategies that you can use for your specific situation here

="UPDATE T_KeyAttribute set description="&
CHAR(34)&B4&CHAR(34)&
" WHERE KeyName="&
CHAR(34)&A4&CHAR(34)
EDS
  • 2,155
  • 1
  • 6
  • 21